diff options
author | Dmitry Kalinkin <dmitry.kalinkin@gmail.com> | 2020-04-25 12:24:13 -0400 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2020-06-14 20:41:55 +0200 |
commit | dc227b579d71f92e24717dac09bbe3846d5a6597 (patch) | |
tree | 9c2cf547257d1261d3dfa84a4656bb5322821dbf /modules/lib-bash/activation-init.sh | |
parent | 7682eb88c496a4ab700b225630589c96cee64600 (diff) |
home-manager: respect NIX_STATE_DIR
This allows to install home-manager on a system without root access.
PR #1196
Diffstat (limited to '')
-rwxr-xr-x | modules/lib-bash/activation-init.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/lib-bash/activation-init.sh b/modules/lib-bash/activation-init.sh index ecf1f550c3e..f95008ee75b 100755 --- a/modules/lib-bash/activation-init.sh +++ b/modules/lib-bash/activation-init.sh @@ -1,8 +1,9 @@ #!/usr/bin/env bash function setupVars() { - local profilesPath="/nix/var/nix/profiles/per-user/$USER" - local gcPath="/nix/var/nix/gcroots/per-user/$USER" + local nixStateDir="${NIX_STATE_DIR:-/nix/var/nix}" + local profilesPath="$nixStateDir/profiles/per-user/$USER" + local gcPath="$nixStateDir/gcroots/per-user/$USER" genProfilePath="$profilesPath/home-manager" newGenPath="@GENERATION_DIR@"; |