Parametrizable derivation builder
Usage:
nix run github:ggpeti/param-pkg myflake#lib.mkMyPkg '<arg-expr>'
Takes a textual nix expression as the final argument. myflake#lib.mkMyPkg
is a function of type any -> derivation
.
Uses nix eval
under the hood but produces the usual result
symlink in the cwd.
Hacks utilized:
- flakes don't support configurable outputs and
--argstr
-> but there isnix eval --apply
nix eval
doesn't instantiate derivation outputs until they are accessed ->builtins.readFileType
does that- lazy evaluation prevents instantiation as well -> but as is widely known, nix is eager in attrset names.