mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
nixos-install: Don't require root
E.g. nixos-install --root /tmp/mnt/ --no-bootloader --no-root-passwd now works for non-root users.
This commit is contained in:
parent
df117acab7
commit
f0979ca30e
1 changed files with 2 additions and 2 deletions
|
@ -82,7 +82,7 @@ fi
|
||||||
trap "rm -rf $tmpdir" EXIT
|
trap "rm -rf $tmpdir" EXIT
|
||||||
tmpdir="$(mktemp -d)"
|
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.
|
# Build the system configuration in the target filesystem.
|
||||||
if [[ -z $system ]]; then
|
if [[ -z $system ]]; then
|
||||||
|
@ -108,7 +108,7 @@ if [[ -z $noChannelCopy ]]; then
|
||||||
if [[ -n $channelPath ]]; then
|
if [[ -n $channelPath ]]; then
|
||||||
echo "copying channel..."
|
echo "copying channel..."
|
||||||
mkdir -p $mountPoint/nix/var/nix/profiles/per-user/root
|
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
|
-p $mountPoint/nix/var/nix/profiles/per-user/root/channels --set "$channelPath" --quiet
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue