about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-05-16T02·04-0400
committerMatthew Bauer <mjbauer95@gmail.com>2019-05-16T02·04-0400
commit7c20ee448fa924d898bcebf84bd0a7caf368a656 (patch)
tree94819954b29f89375e759d2b3fc45066be81a558 /scripts
parent8f6c72faeec2dfd3ce6e48c9539bb5d7a161f37a (diff)
Sync NIX_PROFILES between single-user and multi-user modes
When we are in single user mode, we still want to have access to
profiles. This way things in Nixpkgs that rely on them getting set
accurately are done in both cases. The point where I hit this is with
using aspell which looks in NIX_PROFILES:

https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/aspell/default.nix

Before this patch, NIX_PROFILES was never set in single user mode!
This corrects that.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/nix-profile.sh.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/nix-profile.sh.in b/scripts/nix-profile.sh.in
index f3cfa157c769..85f1d6e5dae2 100644
--- a/scripts/nix-profile.sh.in
+++ b/scripts/nix-profile.sh.in
@@ -57,7 +57,7 @@ if [ -n "$HOME" ] && [ -n "$USER" ]; then
 
     # Set up environment.
     # This part should be kept in sync with nixpkgs:nixos/modules/programs/environment.nix
-    NIX_PROFILES="@localstatedir@/nix/profiles/default $NIX_USER_PROFILE_DIR"
+    export NIX_PROFILES="@localstatedir@/nix/profiles/default $HOME/.nix-profile"
 
     # Set $NIX_SSL_CERT_FILE so that Nixpkgs applications like curl work.
     if [ -e /etc/ssl/certs/ca-certificates.crt ]; then # NixOS, Ubuntu, Debian, Gentoo, Arch
@@ -79,5 +79,5 @@ if [ -n "$HOME" ] && [ -n "$USER" ]; then
     fi
 
     export PATH="$NIX_LINK/bin:$__savedpath"
-    unset __savedpath NIX_LINK NIX_USER_PROFILE_DIR NIX_PROFILES
+    unset __savedpath NIX_LINK NIX_USER_PROFILE_DIR
 fi