Regenerated
This commit is contained in:
+30
-64
@@ -267,7 +267,7 @@ in
|
||||
extraGroups = [ "wheel" "networkmanager" ];
|
||||
};
|
||||
|
||||
# ONLY return HM user attrset (IMPORTANT)
|
||||
# Home Manager user definition
|
||||
_module.args.hmUsers = {
|
||||
${username} = {
|
||||
home.stateVersion = "26.05";
|
||||
@@ -368,65 +368,33 @@ in
|
||||
|
||||
let
|
||||
username = config.defaultUser or "henrov";
|
||||
|
||||
modulesPath = ./generated/modules;
|
||||
imported = inputs.import-tree modulesPath;
|
||||
|
||||
moduleSwitches = import ../../../assets/system/conf/modules.conf;
|
||||
# Import all modules recursively
|
||||
importedModules = inputs.import-tree modulesPath;
|
||||
|
||||
# STEP 1: evaluate all modules
|
||||
# Evaluate all modules
|
||||
evaluatedModules =
|
||||
map (m:
|
||||
if builtins.isFunction m
|
||||
then m { inherit lib config pkgs; }
|
||||
else m
|
||||
) imported.imports;
|
||||
if builtins.isFunction m then m { inherit lib config pkgs; } else m
|
||||
) importedModules.imports;
|
||||
|
||||
# STEP 2: attach normalized names
|
||||
# Attach names
|
||||
modulesWithNames =
|
||||
map (m: {
|
||||
name =
|
||||
if m ? _file
|
||||
then lib.removeSuffix ".nix" (builtins.baseNameOf m._file)
|
||||
else "unknown";
|
||||
name = if m ? _file then lib.removeSuffix ".nix" (builtins.baseNameOf m._file) else "unknown";
|
||||
value = m;
|
||||
}) evaluatedModules;
|
||||
|
||||
# STEP 3: filter enabled modules
|
||||
# Filter enabled modules from config file (optional)
|
||||
moduleSwitches = import ../../../assets/system/conf/modules.conf;
|
||||
enabledModules =
|
||||
builtins.filter (m:
|
||||
moduleSwitches.${m.name} or false
|
||||
) modulesWithNames;
|
||||
builtins.filter (m: moduleSwitches.${m.name} or false) modulesWithNames;
|
||||
|
||||
# STEP 4: extract ONLY Home Manager user attrsets
|
||||
hmUserSets =
|
||||
map (m: m.value._module.args.hmUsers or {}) enabledModules;
|
||||
# Collect Home Manager user attrsets
|
||||
hmUsersList = map (m: m.value._module.args.hmUsers or {}) enabledModules;
|
||||
|
||||
# STEP 5: debug string
|
||||
debugContents =
|
||||
builtins.concatStringsSep "\n"
|
||||
(map (m:
|
||||
let attrCount =
|
||||
if builtins.isAttrs m.value
|
||||
then builtins.length (builtins.attrNames m.value)
|
||||
else 0;
|
||||
in
|
||||
"${m.name} (${builtins.toString attrCount} attrs)"
|
||||
) enabledModules);
|
||||
|
||||
# STEP 6: FORCE trace (important!)
|
||||
tracedModules =
|
||||
builtins.trace
|
||||
("==== Enabled modules (" +
|
||||
builtins.toString (builtins.length enabledModules) +
|
||||
") ====\n" + debugContents)
|
||||
enabledModules;
|
||||
|
||||
# STEP 7: proper debug file in store
|
||||
debugFile = pkgs.writeText "traveldroid-modules-debug.txt" debugContents;
|
||||
|
||||
in
|
||||
{
|
||||
in {
|
||||
networking.hostName = "traveldroid";
|
||||
system.stateVersion = "26.05";
|
||||
|
||||
@@ -435,15 +403,8 @@ in
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
# Merge: ONLY HM user attrsets
|
||||
home-manager.users =
|
||||
lib.mkMerge hmUserSets;
|
||||
|
||||
# Optional: also inside VM
|
||||
environment.etc."traveldroid-modules-debug.txt".text = debugContents;
|
||||
|
||||
# Expose debug file as build output
|
||||
system.build.modulesDebug = debugFile;
|
||||
# Merge Home Manager user configurations
|
||||
home-manager.users = lib.mkMerge hmUsersList;
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
@@ -693,23 +654,28 @@ Finally, it creates a systemd user service (wpaperd.service) that automatically
|
||||
}
|
||||
# #+END_SRC
|
||||
|
||||
** =generated/modules/desktop/hyprland.nix=
|
||||
** =generated/parked/desktop/hyprland.nix=
|
||||
Setting up Hyprland
|
||||
#+BEGIN_SRC nix :tangle generated/modules/desktop/hyprland.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ lib, config, ... }:
|
||||
#+BEGIN_SRC nix :tangle generated/parked/desktop/hyprland.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ lib, config, pkgs, ... }:
|
||||
|
||||
let
|
||||
username = config.defaultUser or "henrov";
|
||||
assetPath = ../../../assets/hyprland/conf/hypr;
|
||||
mainConfigPath = "${assetPath}/hyprland.conf";
|
||||
mainConfig = "${assetPath}/hyprland.conf";
|
||||
in
|
||||
{
|
||||
"${username}" = {
|
||||
settings.general."col.active_border" =
|
||||
lib.mkForce "0xff97cbcd 0xff89b4fa";
|
||||
# Home Manager user settings
|
||||
_module.args.hmUsers = {
|
||||
${username} = {
|
||||
home.packages = [ pkgs.hyprland ];
|
||||
|
||||
xdg.configFile."hypr/hyprland.conf".text =
|
||||
builtins.readFile mainConfigPath;
|
||||
# Set config files under ~/.config/hypr
|
||||
home.file.".config/hypr/hyprland.conf".source = mainConfig;
|
||||
|
||||
# Example additional settings (can extend per module)
|
||||
settings.general."col.active_border" = "0xff97cbcd 0xff89b4fa";
|
||||
};
|
||||
};
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
Reference in New Issue
Block a user