diff --git a/home-manager/home-manager b/home-manager/home-manager index 6f2ba38b..2549cc57 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -29,7 +29,9 @@ function removeByName() { } function setNixProfileCommands() { - if [[ -e $HOME/.nix-profile/manifest.json ]] ; then + if [[ -e $HOME/.nix-profile/manifest.json \ + || -e ${XDG_STATE_HOME:-$HOME/.local/state}/nix/profile/manifest.json ]] ; then + LIST_OUTPATH_CMD="nix profile list" REMOVE_CMD="removeByName" else @@ -406,6 +408,10 @@ $xdgVars # # or # + # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh + # + # or + # # /etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh # home.sessionVariables = { diff --git a/modules/home-environment.nix b/modules/home-environment.nix index 87046460..03e32c08 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -175,7 +175,7 @@ in done automatically if the shell configuration is managed by Home Manager. If not, then you must source the - ~/.nix-profile/etc/profile.d/hm-session-vars.sh + ${cfg.profileDirectory}/etc/profile.d/hm-session-vars.sh file yourself. '') @@ -585,7 +585,7 @@ in if config.submoduleSupport.externalPackageInstall then '' - if [[ -e $HOME/.nix-profile/manifest.json ]] ; then + if [[ -e ${cfg.profileDirectory}/manifest.json ]] ; then nix profile list \ | { grep 'home-manager-path$' || test $? = 1; } \ | cut -d ' ' -f 4 \ @@ -623,7 +623,7 @@ in $DRY_RUN_CMD $oldNix profile install $1 } - if [[ -e $HOME/.nix-profile/manifest.json ]] ; then + if [[ -e ${cfg.profileDirectory}/manifest.json ]] ; then INSTALL_CMD="nix profile install" INSTALL_CMD_ACTUAL="nixReplaceProfile" LIST_CMD="nix profile list"