nix
nix copied to clipboard
nix flake show: don't evaluate derivations for foreign systems by default
Simple implementation of the idea, based on how legacyPackages is handled already. Doesn't cover hydraJobs, unfortunately.
Fixes https://github.com/NixOS/nix/issues/6985
I like this idea, although it conflicts a bit with the idea that the system hierarchy layer should be special-cased as least as can be. But probably that's worth it.
I think we can easily agree on the fact that the way the system is currently handled has a lot of flaws, and doing special handling it will be the only way around it (besides rewriting "flakespec" from scratch).
And I also want to add:
Specialcasing the system within nix' source code wasn't necessary that mouch if we were doing checks and shows in nix expression language, as briefly suggested in #6453 and #6454.
Of course I see, that we would still need to tell the nix expressions what the current system is.
--foreign is not very descriptive as an option name. Maybe --all-systems or something like that?
This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/deduplicating-a-package-definition-between-nixpkgs-and-a-flake/21460/4
Or maybe --systems=all (default value for flag: --systems=local). That would let us also give a specific list of systems to eval (--systems=x86_64-linux,aarch64-linux).
Is there any reason why we need this instead of just catching errors that happen due to not being able to build a drv and omitting those parts of the output?
For nix flake show, probably it would be the same. However, for nix flake check we would need a way to check the flake only for the current arch. Otherwise an IFS would always become an error, even if it's not.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/announcing-stacklock2nix-easily-build-a-haskell-project-that-contains-a-stack-yaml-lock-file/23563/5
Lost ~hour today due to this unexpected behavor while working on https://github.com/cachix/cachix/pull/476
What is stopping this fix from being merged?
What is stopping this fix from being merged?
Nothing really.
@max-privatevoid I've merged master back into this and added a few tests. Let me know whether that looks good to you
Oh also: I've noticed that this doesn't apply to legacyPackages. Is it intentional?
(I don't think it should be a blocker, and I think it makes sense either way, just wants to make sure it's not an overlook)
Thanks for writing the tests. I've added the functionality to legacyPackages as well now. I definitely meant to have the flag work there too, just forgot about it.
Awesome, thanks. I've just pushed a fix for the tests because they were broken on non-x86_64-linux. If the CI is OK, it'll just merge
Thanks for this PR, I am trying to use it to implement the same behavior for nix flake check: https://github.com/NixOS/nix/pull/7759
This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/nix-2-14-0-released/25900/2
This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/nix-team-report-2022-10-2023-03/27486/1