Closes #496 When running nix-build ../nixpkgs --arg config.allowUnfree true -A hello-unfree the package `hello-unfree` is now built rather than getting an eval-error rejecting instantiation. This is because `config.allowUnfree` is now interpreted as nested attribute-set declaration, similar to how it's done in `nix repl`. To prevent sudden breakage, this behavior was carefully deprecated with Nix throwing an error if the identifier for `--arg` is not a pure identifier, but an expression as above. Any kind of merging is rejected. I.e. doing nix-build ../nixpkgs --arg config '{cudaSupport = true;}' --arg config.allowUnfree true is prohibited. That way we don't have to think about merge semantics for cases like this (or even worse `--arg config 'rec { ... }'`). Another nice side-effect of this is that we don't need to create an EvalState to force the values and implement merging. Change-Id: I8b560883a4468a3f32f915764b08f5fdd8fe71bb
289 B
289 B
synopsis, cls, category, credits, issues
| synopsis | cls | category | credits | issues | |||
|---|---|---|---|---|---|---|---|
| allow setting nested attributes via `--arg`/`--argstr` |
|
Features |
|
|
Passing --arg config.allowUnfree true to e.g. nix-build now results in config with value
{ allowUnfree = true; } passed to the expression.