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.
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 runningnix build
, which works fine on my local machine.When I run nixos-anywhere with the specified sandbox option, however, I get the following error:
I've also tried running it with
--option sandbox false
, no success that way either.System information