Conversation
This PR is a back-compatible subset of #84. By adding a new flake input here, it makes it possible to override the list of systems using flake overrides. See <https://github.com/nix-systems/nix-systems> for the full explanation.
re-expose defaultSystems even if it doesn't make a lot of sense anymore, to not break back-compat.
re-expose defaultSystems even if it doesn't make a lot of sense anymore, to not break back-compat.
| lib = import ./.; | ||
|
|
||
| # Externally extensible flake systems. See <https://github.com/nix-systems/nix-systems>. | ||
| inputs.systems.url = "github:nix-systems/default"; |
There was a problem hiding this comment.
Doesn't this introduce a new flake input for every flake-utils inputs? In my config this would add 11 new flake inputs.
You can also not overwrite nested inputs without repeating the URL making this not as useful as it could be.
There was a problem hiding this comment.
That's right, those 11 flakes are now automatically externally extensible if they use defaultSystem or eachDefaultSystem. The nix-sytems/default flake is a few kilobytes big.
You can also not overwrite nested inputs without repeating the URL making this not as useful as it could be.
I don't understand this point. If the "follows" mechanism not working?
There was a problem hiding this comment.
The nix-sytems/default flake is a few kilobytes big.
The size of the flake is not really a problem, but it still increases the number of flake inputs which slows down all download operations.
I don't understand this point. If the "follows" mechanism not working?
You cannot overwrite flake-utils systems input if flake-utils is a dependency of another flake unless nix knows the URL of the flake-utils input.
If you have project -> flake-utils -> systems then flake-utils URL must either be written in the flake input, it must follow another flake input where the URL is known or I think it may also work if it is part of the registry, otherwise nix complains about that.
There was a problem hiding this comment.
If you have project -> flake-utils -> systems then flake-utils URL must either be written in the flake input, it must follow another flake input where the URL is known or I think it may also work if it is part of the registry, otherwise nix complains about that.
Do you have an example of that?
So far the project I have, the diff is only two lines:
+inputs.systems.url = "github:nix-systems/x86_64-linux";+flake-utils.inputs.systems.follows = "systems";
And all the other inputs that use flake-utils were already following "flake-utils"
There was a problem hiding this comment.
Interesting 🤔 I just revisted that and I think I know what went wrong when I last tested this: I put a flake URI in follows which makes no sense. Thanks for the headsup!
There was a problem hiding this comment.
and I think the annoyance I encountered was that you needed to add the url of the flake input otherwise you get
▶ nix flake metadata
error: cannot find flake 'flake:treefmt-nix' in the flake registries
(use '--show-trace' to show detailed location information)
which made overwriting nested flake inputs only half as nice.
This PR is a back-compatible subset of #84.
By adding a new flake input here, it makes it possible to override the
list of systems using flake overrides.
See https://github.com/nix-systems/nix-systems for the full
explanation.
Thanks to @bb010g for the initial implementation and inspiration.