I’m trying to build a derivation in pure evaluation mode to make sure that it will also work with Flakes and possibly on Hydra. So I made a test derivation which should definitely be pure:
default.nix
derivation {
name = "pure-eval-test";
builder = ./builder.sh;
system = "x86_64-linux";
}
builder.sh
#!/bin/sh
echo "" > $out
However, running nix-build
with pure evaluation turned on reports:
$ nix-build --option pure-eval true default.nix
error: --- RestrictedPathError --- nix-build
access to path '/home/henri/default.nix' is forbidden in restricted mode
This is of course very pure by not even allowing to read the input file, but I have the feeling that this sort of defeats the purpose. What am I doing wrong here?