I have been pulling my hair over this for a long time and I just can’t see a way of doing. How do I disable the sandbox
with nix-build
? I have tried the following:
1, NIX_CONF_DIR=~/.config/nix nix-build ....
in which the nix.conf
in the NIX_CONF_DIR
has a line with sandbox = false
2. nix-build --option sandbox false ..
This is manual I’m reading to configure nix
: nix.conf
➜ nix-info -m
- system: `"x86_64-linux"`
- host os: `Linux 5.16.5, NixOS, 21.11 (Porcupine)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.6.0`
- channels(sebas): `"stable-21.11.335883.7adc9c14ec7, unstable-22.05pre352484.1882c6b7368"`
- channels(root): `"nixos-21.11"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
I know I can disable the sandbox by setting sandbox = false
in /etc/nix/nix.conf
in the configuration.nix by doing this:
nix = {
#useSandbox = false;
# or
extraOptions = ''sandbox = false'';
package = (import (fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/refs/heads/nixos-unstable-small.tar.gz";
sha256 = "1hq483rnv67i682yqr83vmpz5rw4xpx3frspslx3lzzbd6w8cbnh";
}) {}).pkgs.nix_2_6;
What I want is for a single execution of nix-build
to have sandbox disabled and not have to run nixos-rebuild switch
Thank you for reading.