Skip to content

Commit

Permalink
installer.sh: workaround for sandbox builds
Browse files Browse the repository at this point in the history
The new default nix.useSandbox = true breaks calling nix-env from
nixos-enter with the error

error: cloning builder process: Operation not permitted

Until a proper fix is found, we explicitely disable sandbox builds
in the installer script when generating the final configuration
on the install target.
  • Loading branch information
alexandergall committed Jan 4, 2019
1 parent db18503 commit 6bf2853
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,11 @@ nixos-generate-config --root /mnt
export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix

informOk "generating system configuration..."
## FIXME: starting with 18.09, nix.useSandbox defaults to true, which breaks the execution of
## nix-env in a chroot when the builder needs to be invoked. Disabling the sandbox
## is a workaround.
nixos-enter --root /mnt -c "mv /resolv.conf /etc && \
/run/current-system/sw/bin/nix-env -p /nix/var/nix/profiles/system -f '<nixpkgs/nixos>' --set -A system"
/run/current-system/sw/bin/nix-env --option sandbox false -p /nix/var/nix/profiles/system -f '<nixpkgs/nixos>' --set -A system"
informOk "...system configuration done"

informOk "activating final configuration..."
Expand Down

0 comments on commit 6bf2853

Please sign in to comment.