Regenerated

This commit is contained in:
2026-03-27 14:59:11 +00:00
parent d4dbe5069a
commit 33a6f7fd72
4 changed files with 345 additions and 462 deletions
+315 -354
View File
File diff suppressed because it is too large Load Diff
+15 -54
View File
@@ -141,38 +141,12 @@ let
allModules = hostModules.imports ++ globalUsers.imports; allModules = hostModules.imports ++ globalUsers.imports;
#########################################################
# Merge all _module.args.hmUsers safely
#########################################################
mergedHmUsers = lib.mkMerge (
builtins.concatLists (
map (m:
if builtins.hasAttr "args" m && builtins.hasAttr "hmUsers" m.args
then [ m.args.hmUsers ] # wrap in singleton list
else []
) allModules
)
);
#########################################################
# Add activation to ensure all parent directories exist
#########################################################
mergedHmUsersWithDirs = lib.mapAttrs (_: userCfg: userCfg // {
home.activation.ensureDirs = lib.hm.dag.entryAfter ["writeBoundary"] (let
ensureDirs = files: lib.mapAttrs (_: path: ''
mkdir -p $(dirname $HOME/${path})
'') files;
in
ensureDirs (builtins.attrNames (userCfg.home.file or {}))
);
}) mergedHmUsers;
in in
{ {
################################# #################################
# Core system config # Core system config
################################# #################################
networking.hostName = hostname; networking.hostName = hostname; # <-- set hostname here
system.stateVersion = "26.05"; system.stateVersion = "26.05";
################################# #################################
@@ -192,8 +166,8 @@ in
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
# Apply merged users with automatic directory creation # Each module sets its own home-manager.users; no manual merging needed
home-manager.users = mergedHmUsersWithDirs; # NixOS module system will merge them automatically
################################# #################################
# System packages & programs # System packages & programs
@@ -955,40 +929,27 @@ in
** =generated/modules/traveldroid/apps/wofi.nix= ** =generated/modules/traveldroid/apps/wofi.nix=
This is the install for Wofi, the launcher This is the install for Wofi, the launcher
#+BEGIN_SRC nix :tangle generated/modules/traveldroid/apps/wofi.nix :noweb yes :mkdirp yes :eval never #+BEGIN_SRC nix :tangle generated/modules/traveldroid/apps/wofi.nix :noweb yes :mkdirp yes :eval never
{ lib, config, pkgs, flakeRoot, home-manager, ... }: { lib, config, pkgs, flakeRoot, ... }:
let let
programName = "wofi";
username = config.defaultUser or "henrov"; username = config.defaultUser or "henrov";
assetPath = "${flakeRoot}/generated/.config/wofi"; assetPath = "${flakeRoot}/generated/.config/wofi";
in in
{ {
# Install Wofi via system packages home-manager.users = {
environment.systemPackages = [ ${username} = {
pkgs.wofi home.file = {
]; ".config/wofi/config" = {
source = "${assetPath}/config";
_module.args.hmUsers = { force = true;
${username} = { };
".config/wofi/style.css" = {
home.file = { source = "${assetPath}/style.css";
".config/wofi/config" = { force = true;
source = "${assetPath}/config";
force = true; # overwrite existing
};
".config/wofi/style.css" = {
source = "${assetPath}/style.css";
force = true; # overwrite existing
};
}; };
# Ensure ~/.config/wofi exists before writing files
home.activation.fixWofiDir = lib.hm.dag.entryAfter ["writeBoundary"] ''
mkdir -p $HOME/.config/wofi
chmod -R u+rwx $HOME/.config/wofi
'';
}; };
}; };
};
} }
#+END_SRC #+END_SRC
+3 -29
View File
@@ -11,38 +11,12 @@ let
allModules = hostModules.imports ++ globalUsers.imports; allModules = hostModules.imports ++ globalUsers.imports;
#########################################################
# Merge all _module.args.hmUsers safely
#########################################################
mergedHmUsers = lib.mkMerge (
builtins.concatLists (
map (m:
if builtins.hasAttr "args" m && builtins.hasAttr "hmUsers" m.args
then [ m.args.hmUsers ] # wrap in singleton list
else []
) allModules
)
);
#########################################################
# Add activation to ensure all parent directories exist
#########################################################
mergedHmUsersWithDirs = lib.mapAttrs (_: userCfg: userCfg // {
home.activation.ensureDirs = lib.hm.dag.entryAfter ["writeBoundary"] (let
ensureDirs = files: lib.mapAttrs (_: path: ''
mkdir -p $(dirname $HOME/${path})
'') files;
in
ensureDirs (builtins.attrNames (userCfg.home.file or {}))
);
}) mergedHmUsers;
in in
{ {
################################# #################################
# Core system config # Core system config
################################# #################################
networking.hostName = hostname; networking.hostName = hostname; # <-- set hostname here
system.stateVersion = "26.05"; system.stateVersion = "26.05";
################################# #################################
@@ -62,8 +36,8 @@ in
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
# Apply merged users with automatic directory creation # Each module sets its own home-manager.users; no manual merging needed
home-manager.users = mergedHmUsersWithDirs; # NixOS module system will merge them automatically
################################# #################################
# System packages & programs # System packages & programs
@@ -1,35 +1,22 @@
{ lib, config, pkgs, flakeRoot, home-manager, ... }: { lib, config, pkgs, flakeRoot, ... }:
let let
programName = "wofi";
username = config.defaultUser or "henrov"; username = config.defaultUser or "henrov";
assetPath = "${flakeRoot}/generated/.config/wofi"; assetPath = "${flakeRoot}/generated/.config/wofi";
in in
{ {
# Install Wofi via system packages home-manager.users = {
environment.systemPackages = [ ${username} = {
pkgs.wofi home.file = {
]; ".config/wofi/config" = {
source = "${assetPath}/config";
_module.args.hmUsers = { force = true;
${username} = { };
".config/wofi/style.css" = {
home.file = { source = "${assetPath}/style.css";
".config/wofi/config" = { force = true;
source = "${assetPath}/config";
force = true; # overwrite existing
};
".config/wofi/style.css" = {
source = "${assetPath}/style.css";
force = true; # overwrite existing
};
}; };
# Ensure ~/.config/wofi exists before writing files
home.activation.fixWofiDir = lib.hm.dag.entryAfter ["writeBoundary"] ''
mkdir -p $HOME/.config/wofi
chmod -R u+rwx $HOME/.config/wofi
'';
}; };
}; };
};
} }