home-environment: use per-user profile path in /etc
Before the profile directory value would point directly to the build output in the Nix store. Unfortunately this would cause an infinite loop if the user's configuration directly or indirectly refers to the profile directory value. Fixes #1188
This commit is contained in:
parent
1a8ab9d9de
commit
a49ce0e9ed
|
@ -402,7 +402,7 @@ in
|
||||||
home.profileDirectory =
|
home.profileDirectory =
|
||||||
if config.submoduleSupport.enable
|
if config.submoduleSupport.enable
|
||||||
&& config.submoduleSupport.externalPackageInstall
|
&& config.submoduleSupport.externalPackageInstall
|
||||||
then config.home.path
|
then "/etc/profiles/per-user/${cfg.username}"
|
||||||
else cfg.homeDirectory + "/.nix-profile";
|
else cfg.homeDirectory + "/.nix-profile";
|
||||||
|
|
||||||
home.sessionVariables =
|
home.sessionVariables =
|
||||||
|
|
|
@ -72,6 +72,8 @@ in
|
||||||
}) cfg.users
|
}) cfg.users
|
||||||
);
|
);
|
||||||
|
|
||||||
|
environment.pathsToLink = mkIf cfg.useUserPackages [ "/etc/profile.d" ];
|
||||||
|
|
||||||
system.activationScripts.postActivation.text =
|
system.activationScripts.postActivation.text =
|
||||||
concatStringsSep "\n" (mapAttrsToList (username: usercfg: ''
|
concatStringsSep "\n" (mapAttrsToList (username: usercfg: ''
|
||||||
echo Activating home-manager configuration for ${username}
|
echo Activating home-manager configuration for ${username}
|
||||||
|
|
|
@ -88,6 +88,8 @@ in {
|
||||||
(mapAttrs (username: usercfg: { packages = [ usercfg.home.path ]; })
|
(mapAttrs (username: usercfg: { packages = [ usercfg.home.path ]; })
|
||||||
cfg.users);
|
cfg.users);
|
||||||
|
|
||||||
|
environment.pathsToLink = mkIf cfg.useUserPackages [ "/etc/profile.d" ];
|
||||||
|
|
||||||
systemd.services = mapAttrs' (_: usercfg:
|
systemd.services = mapAttrs' (_: usercfg:
|
||||||
let username = usercfg.home.username;
|
let username = usercfg.home.username;
|
||||||
in nameValuePair ("home-manager-${utils.escapeSystemdPath username}") {
|
in nameValuePair ("home-manager-${utils.escapeSystemdPath username}") {
|
||||||
|
|
Loading…
Reference in a new issue