diff --git a/modules/home-environment.nix b/modules/home-environment.nix index d868ee42..209df4ff 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -402,7 +402,7 @@ in home.profileDirectory = if config.submoduleSupport.enable && config.submoduleSupport.externalPackageInstall - then config.home.path + then "/etc/profiles/per-user/${cfg.username}" else cfg.homeDirectory + "/.nix-profile"; home.sessionVariables = diff --git a/nix-darwin/default.nix b/nix-darwin/default.nix index 4b226d44..ce6105d4 100644 --- a/nix-darwin/default.nix +++ b/nix-darwin/default.nix @@ -72,6 +72,8 @@ in }) cfg.users ); + environment.pathsToLink = mkIf cfg.useUserPackages [ "/etc/profile.d" ]; + system.activationScripts.postActivation.text = concatStringsSep "\n" (mapAttrsToList (username: usercfg: '' echo Activating home-manager configuration for ${username} diff --git a/nixos/default.nix b/nixos/default.nix index bb0e534a..9aedf618 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -88,6 +88,8 @@ in { (mapAttrs (username: usercfg: { packages = [ usercfg.home.path ]; }) cfg.users); + environment.pathsToLink = mkIf cfg.useUserPackages [ "/etc/profile.d" ]; + systemd.services = mapAttrs' (_: usercfg: let username = usercfg.home.username; in nameValuePair ("home-manager-${utils.escapeSystemdPath username}") {