aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-05-21 13:28:28 +0200
committerGitHub <noreply@github.com>2019-05-21 13:28:28 +0200
commitcdcdf3e798373b06c8c3e2b53c5722b91ea5f42e (patch)
tree809f53d4cb6be27dea6b05fc92d2bfab80c95e87
parent14c877b4ab097667734b050a79b45658dcf2695d (diff)
parent92f461e4f46b595e3712b41c30b8403905dd8673 (diff)
Merge pull request #2812 from matthewbauer/fix-nix-scripts
Sync NIX_PROFILES between single-user and multi-user modes
-rw-r--r--scripts/nix-profile-daemon.sh.in6
-rw-r--r--scripts/nix-profile.sh.in4
2 files changed, 2 insertions, 8 deletions
diff --git a/scripts/nix-profile-daemon.sh.in b/scripts/nix-profile-daemon.sh.in
index 6940969cc..23da5e855 100644
--- a/scripts/nix-profile-daemon.sh.in
+++ b/scripts/nix-profile-daemon.sh.in
@@ -2,12 +2,6 @@
if [ -n "${__ETC_PROFILE_NIX_SOURCED:-}" ]; then return; fi
__ETC_PROFILE_NIX_SOURCED=1
-# Set up secure multi-user builds: non-root users build through the
-# Nix daemon.
-if [ "$USER" != root -o ! -w @localstatedir@/nix/db ]; then
- export NIX_REMOTE=daemon
-fi
-
export NIX_USER_PROFILE_DIR="@localstatedir@/nix/profiles/per-user/$USER"
export NIX_PROFILES="@localstatedir@/nix/profiles/default $HOME/.nix-profile"
diff --git a/scripts/nix-profile.sh.in b/scripts/nix-profile.sh.in
index f3cfa157c..85f1d6e5d 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