about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-02-07 17:20:26 +0100
committerEelco Dolstra <edolstra@gmail.com>2018-02-07 17:20:26 +0100
commitf0979ca30e657b16a840fe8977fb833c762d53c3 (patch)
treeb3c69786fe3f3045781e867793179f4ec4d0b460
parentdf117acab7bf345500ffada26c240c9f815b7c21 (diff)
downloadnixlib-f0979ca30e657b16a840fe8977fb833c762d53c3.tar
nixlib-f0979ca30e657b16a840fe8977fb833c762d53c3.tar.gz
nixlib-f0979ca30e657b16a840fe8977fb833c762d53c3.tar.bz2
nixlib-f0979ca30e657b16a840fe8977fb833c762d53c3.tar.lz
nixlib-f0979ca30e657b16a840fe8977fb833c762d53c3.tar.xz
nixlib-f0979ca30e657b16a840fe8977fb833c762d53c3.tar.zst
nixlib-f0979ca30e657b16a840fe8977fb833c762d53c3.zip
nixos-install: Don't require root
E.g.

  nixos-install --root /tmp/mnt/ --no-bootloader --no-root-passwd

now works for non-root users.
-rw-r--r--nixos/modules/installer/tools/nixos-install.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/installer/tools/nixos-install.sh b/nixos/modules/installer/tools/nixos-install.sh
index 69371f3e4132..222211df2789 100644
--- a/nixos/modules/installer/tools/nixos-install.sh
+++ b/nixos/modules/installer/tools/nixos-install.sh
@@ -82,7 +82,7 @@ fi
 trap "rm -rf $tmpdir" EXIT
 tmpdir="$(mktemp -d)"
 
-subs="local?trusted=1 https://cache.nixos.org/"
+subs="auto?trusted=1 https://cache.nixos.org/"
 
 # Build the system configuration in the target filesystem.
 if [[ -z $system ]]; then
@@ -108,7 +108,7 @@ if [[ -z $noChannelCopy ]]; then
     if [[ -n $channelPath ]]; then
         echo "copying channel..."
         mkdir -p $mountPoint/nix/var/nix/profiles/per-user/root
-        nix-env --store "$mountPoint" --substituters 'local?trusted=1' "${extraBuildFlags[@]}" \
+        nix-env --store "$mountPoint" --substituters 'auto?trusted=1' "${extraBuildFlags[@]}" \
                 -p $mountPoint/nix/var/nix/profiles/per-user/root/channels --set "$channelPath" --quiet
     fi
 fi