I have a derivation which I would like to pass command line arguments to without enumerating all the different possibilities. In principle the @
operator should do what I want.
args@{ explicit, ... }:
with import <nixpkgs> {};
builtins.trace "${builtins.toJSON args}"
stdenv.mkDerivation { name = "test"; }
However, when instantiating this derivation I get
$ nix-instantiate test.nix --argstr explicit "explicit" --argstr implicit "implicit"
trace: {"explicit":"explicit"}
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
/nix/store/kfp1phrjhqvp47qi8y1gkfaqhaj6f48c-test.drv
So the args
attribute set does not contain the implicit
parameter. Why is that and what can I do about it?