fix: use home-manager imports for user home configuration

This commit is contained in:
Jake Hamilton 2024-02-04 13:07:17 -08:00
parent 6f2e2819df
commit 40d3ef44b4
No known key found for this signature in database
GPG key ID: 9762169A1B35EA68

View file

@ -315,6 +315,8 @@ in
=============
'')
user-option;
home-config = mkAliasAndWrapDefinitions wrap-user-options options.snowfallorg.user;
in
{
_file = "virtual:snowfallorg/home/user/${name}";
@ -326,13 +328,14 @@ in
enable = true;
name = mkDefault user-name;
};
home.stateVersion = "22.11";
};
home-manager = {
users.${user-name} = mkAliasAndWrapDefinitions wrap-user-options options.snowfallorg.user;
# sharedModules = other-modules ++ optional config.snowfallorg.user.${user-name}.home.enable wrapped-user-module;
sharedModules = other-modules ++ optional config.snowfallorg.user.${user-name}.home.enable user-module;
users.${user-name} = mkIf config.snowfallorg.user.${user-name}.home.enable ({ pkgs, ... }: {
imports = (home-config.imports or [ ]) ++ other-modules ++ [user-module];
config = home-config;
});
# NOTE: Without this home-manager will instead create its own package set which won't contain the same config and
# user-defined packages/overlays as the flake's nixpkgs channel.
@ -347,7 +350,6 @@ in
extra-special-args-module
snowfall-user-home-module
]
++ (users.modules or [ ])
++ shared-modules
++ system-modules;
};