Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos-anywhere doesn't respect --option sandbox relaxed or --option sandbox false flags #397

Open
hatredholder opened this issue Sep 27, 2024 · 0 comments

Comments

@hatredholder
Copy link

Issue

In my NixOS configuration I have a derivation which uses __noChroot = true to disable the sandbox and have internet access. In order to build the configuration I must set --option sandbox relaxed flag before running nix build, which works fine on my local machine.

When I run nixos-anywhere with the specified sandbox option, however, I get the following error:

$ nix run github:nix-community/nixos-anywhere -- --flake .#nixos --option sandbox relaxed root@ip

...

error:
       … while calling the 'head' builtin

         at /nix/store/x76i82ichcxssszb5i0ppzlmffms9iyk-source/lib/attrsets.nix:1575:11:

         1574|         || pred here (elemAt values 1) (head values) then
         1575|           head values
             |           ^
         1576|         else

       … while evaluating the attribute 'value'

         at /nix/store/x76i82ichcxssszb5i0ppzlmffms9iyk-source/lib/modules.nix:821:9:

          820|     in warnDeprecation opt //
          821|       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          822|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: derivation '/nix/store/apnjia83x4kr3730f41ssyh0b8njc2rx-ytdata.json.drv' has '__noChroot' set, but that's not allowed when 'sandbox' is 'true'

I've also tried running it with --option sandbox false, no success that way either.

System information

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.52, NixOS, 24.11 (Vicuna), 24.11.20240919.c04d565`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - nixpkgs: `/nix/store/hiasfhl8f5yy88hcfbr3s8s4bm63wsjw-source`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant