Nix installable resolution is actually impure for supposedly pure attributes like nixosConfigurations
#8665
Labels
feature
Feature request or proposal
flakes
idea approved
The given proposal has been discussed and approved by the Nix team. An implementation is welcome.
new-cli
Relating to the "nix" command
Describe the bug
Let me be clear. We usually don't want to ignore the context of a Nix CLI invocation.
nix run
should not require users to specify their platform.However, in some cases we do want to ignore the CLI context. For instance,
nixosConfigurations
is not behind a system attribute set, because a machine configuration should be built in one way only. Reproducibly.It would seem that the documented schema enforces this. No system attribute means one way to do it, but this is actually not the case, and users are finding out. I'll try not to proliferate the bad idea, but it involves installable resolution. So I'll jump to the solution instead.
Steps To Reproduce
Intentionally omitted.
Expected behavior
Nix implements a flag so that
currentSystem
is not used during installable resolution. I believe this comes down to treating the fragment as a literal attribute path without any lookup trickery.nixos-rebuild
passes this flag.nix-env --version
outputAdditional context
Even
nixpkgs.buildPlatform
would be a massive impurity not to be overlooked by a flake's git history.Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: