If source is followed by ?, then it is not an error if source does not exist; for example, /dev/nvidiactl? specifies that /dev/nvidiactl will only be mounted in the sandbox if it exists in the host filesystem.
extra-sandbox-paths (at least, as far as I can tell), does not allow you to provide this operator to get the same behaviour. I have not verified whether or not sandbox-paths has the behavior stated, but the manual says that it should. I think that extra-sandbox-paths should also have this behavior.
Steps To Reproduce
Add something like provided below, where the sandbox paths do not actually exist yet in the store.
extra-sandbox-paths = with pkgs; toString( map (package: "${package}?") [bash qemu]);
The build will fail due to the non-existence despite the ?.
Expected behavior
It does not fail to build because it cannot find the path that the package points to, because the ? overrides it erroring.
error: while setting up the build environment: getting attributes of path '/nix/store/r0pswys68sglqbx1s8ffypyaxa94w8g1-qemu-6.0.0': No such file or directory
Describe the bug
The documentation for sandbox-paths states:
extra-sandbox-paths (at least, as far as I can tell), does not allow you to provide this operator to get the same behaviour. I have not verified whether or not sandbox-paths has the behavior stated, but the manual says that it should. I think that extra-sandbox-paths should also have this behavior.
Steps To Reproduce
Add something like provided below, where the sandbox paths do not actually exist yet in the store.
The build will fail due to the non-existence despite the ?.
Expected behavior
It does not fail to build because it cannot find the path that the package points to, because the ? overrides it erroring.
nix-env --version
outputnix-env (Nix) 2.3.15
Additional context
Encountered under CI with run provided, commit provided. Error provided also. https://github.com/kittywitch/nixfiles/runs/3492653835 (see nix setup) https://github.com/kittywitch/nixfiles/commit/97c7bd5ec33b7b88cda3e097cae51df57234f301
Nix config file obtained from CI: