Regenerated

This commit is contained in:
2026-03-27 08:42:39 +00:00
parent c51b1f4940
commit d24d23748e
2 changed files with 22 additions and 54 deletions
+11 -27
View File
@@ -6,25 +6,25 @@ let
modulesPath = "${flakeRoot}/generated/modules/${hostname}";
usersPath = "${flakeRoot}/generated/users";
# Import raw modules (might be functions)
hostModulesRaw = import-tree modulesPath;
globalUsersRaw = import-tree usersPath;
# Helper to fully evaluate import-tree nodes into module sets
# Evaluate functions from import-tree
evalModule = m:
if lib.isFunction m then
m { lib = lib; pkgs = pkgs; config = config; flakeRoot = flakeRoot; home-manager = home-manager; }
else
m;
# Evaluate all modules into sets
hostModules = lib.mapAttrsToList (_: mod: evalModule mod) hostModulesRaw;
globalUsers = lib.mapAttrsToList (_: mod: evalModule mod) globalUsersRaw;
hostModules = lib.mapAttrs (_: mod: evalModule mod) hostModulesRaw;
globalUsers = lib.mapAttrs (_: mod: evalModule mod) globalUsersRaw;
# Merge all evaluated modules
allModules = hostModules ++ globalUsers;
# Merge all _module.args.hmUsers
# Flatten modules for imports
flattenModules = lib.flatten (lib.map (m: [ m ]) allModules);
# Merge all _module.args.hmUsers safely
allHmUsers = lib.foldl' (acc: m:
let
hmUsers = if (builtins.hasAttr "_module" m) &&
@@ -37,38 +37,22 @@ let
in
{
#################################
# Core system config
#################################
networking.hostName = hostname;
system.stateVersion = "26.05";
#################################
# Imports
#################################
# Use flattened module list in imports
imports =
[
flattenModules
++ [
./boot.nix
./hardware-configuration.nix
home-manager.nixosModules.home-manager
]
++ allModules;
#################################
# Home Manager integration
#################################
];
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
# Inject the merged users directly under Home Manager
home-manager.users = allHmUsers;
#################################
# Example: system packages
#################################
environment.systemPackages = [
pkgs.dconf
];