diff --git a/hosts/darwinHosts/prometheus/configuration.nix b/hosts/darwinHosts/prometheus/configuration.nix index f57dbd3..4e18e7a 100644 --- a/hosts/darwinHosts/prometheus/configuration.nix +++ b/hosts/darwinHosts/prometheus/configuration.nix @@ -19,13 +19,9 @@ useUserPackages = true; verbose = true; backupFileExtension = "hmbak"; - users.osbm = import ../../../modules/home-manager/default.nix { - inherit config pkgs lib; - username = "osbm"; - homeDirectory = "/Users/osbm"; - stateVersion = "24.11"; - enableGTK = false; - enableGhostty = false; + users.osbm = { + imports = [ ../../../modules/home-manager ]; + home.stateVersion = "24.11"; }; }; diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index dde3bf8..406de61 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -13,6 +13,9 @@ EDITOR = lib.mkDefault "nvim"; }; + # Don't set stateVersion here - let it be set by the system configuration + # home.stateVersion should be set in the system's home-manager configuration + # Enable basic programs that most users want programs.home-manager.enable = true; } diff --git a/modules/nixos/system/home-manager.nix b/modules/nixos/system/home-manager.nix index 75289df..a94170a 100644 --- a/modules/nixos/system/home-manager.nix +++ b/modules/nixos/system/home-manager.nix @@ -25,16 +25,17 @@ extraSpecialArgs = { inherit inputs; }; # Configure home-manager for each user (excluding root) - users = + users = let # Capture the NixOS system config before entering the home-manager scope systemConfig = config; in lib.genAttrs (builtins.filter (u: u != "root") config.osbmModules.users) (username: { - home.stateVersion = lib.mkDefault "24.05"; - imports = [ - ../../home-manager - ] + # Use the system's stateVersion for home-manager + home.stateVersion = lib.mkDefault systemConfig.system.stateVersion; + imports = [ + ../../home-manager + ] ++ lib.optionals systemConfig.osbmModules.hardware.disko.zfs.root.impermanenceRoot [ # Import impermanence home-manager module when impermanence is enabled inputs.impermanence.homeManagerModules.impermanence