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