diff --git a/home-manager/home-manager b/home-manager/home-manager index e41e4b4bc..4f3380ac6 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -127,6 +127,11 @@ function setHomeManagerNixPath() { # Sets some useful Home Manager related paths as global read-only variables. function setHomeManagerPathVariables() { + # If called twice then just exit early. + if [[ -v HM_DATA_HOME ]]; then + return + fi + declare -r globalNixStateDir="${NIX_STATE_DIR:-/nix/var/nix}" declare -r globalProfilesDir="$globalNixStateDir/profiles/per-user/$USER" declare -r globalGcrootsDir="$globalNixStateDir/gcroots/per-user/$USER"