Nix/tests/functional/impure-env.nix
Ninlives 94e91566ed
Allow CLI to pass environment variables to FOD builder (#8830)
Add a new experimental `impure-env` setting that is a key-value list of
environment variables to inject into FOD derivations that specify the
corresponding `impureEnvVars`.

This allows clients to make use of this feature (without having to change the
environment of the daemon itself) and might eventually deprecate the current
behaviour (pick whatever is in the environment of the daemon) as it's more
principled and might prevent information leakage.
2023-10-11 11:58:42 +00:00

17 lines
276 B
Nix

{ var, value }:
with import ./config.nix;
mkDerivation {
name = "test";
buildCommand = ''
echo ${var} = "''$${var}"
echo -n "''$${var}" > "$out"
'';
impureEnvVars = [ var ];
outputHashAlgo = "sha256";
outputHash = builtins.hashString "sha256" value;
}