flake: add overridable systems input#3311
Conversation
systems input
GaetanLepage
left a comment
There was a problem hiding this comment.
I always find it weird to rely on an extra repo for this.
But anyways, I think this is a good idea and gives extra flexibility to the users, so let's have it :)
We don't have to. We could use Using an external repo is just a minor convenience, in that we don't need our own list of systems. Also, if we use nix 2.26+ to create a lockfile with a relative-path input, then that lockfile isn't backwards compatible with nix <2.26. As for needing an extra input; that's a design limitation with flakes. The way flakes deal with "systems" is one of the major flaws pointed out by those who want to make breaking changes to the "experimental" flakes design. Let's not dig up that can of worms here! 🥫 |
Without NixOS/flake-compat#71, we kinda do need to use an external input. Using a relative path input will break flake-compat. In my personal config, I worked around this by using NixOS/flake-compat#71 as my |
Users can specify which systems to use by having our `systems` input
follow a different file or flake:
```nix
{
inputs = {
# Here we list systems in a local file
inputs.systems.url = "path:./systems.nix";
inputs.systems.flake = false;
inputs.nixvim.url = "github:nix-community/nixvim";
# Here we override the list of systems with only our own
inputs.nixvim.inputs.systems.follows = "systems";
# ...
};
outputs = inputs: {
# ...
};
}
```
Alternatively, instead of users listing systems in a local file, they
can use an external flake, e.g.:
- github:nix-systems/default
- Exposes aarch64 and x86_64 for linux and darwin
- github:nix-systems/default-linux
- Exposes aarch64 and x86_64 for linux
- github:nix-systems/default-darwin
- Exposes aarch64 and x86_64 for darwin
- github:nix-systems/aarch64-darwin
- github:nix-systems/aarch64-linux
- github:nix-systems/x86_64-darwin
- github:nix-systems/x86_64-linux
See https://github.com/nix-systems/nix-systems
b68e1a5 to
3212791
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This pull request, with head sha This pull request will be automatically closed by GitHub.As soon as GitHub detects that the sha It is possible for this pull request to remain open if this detection does not happen, this usually happens when a force-push is done on this branch |
Thanks for the clarification @MattSturgeon :) |
Users can specify which systems to use by having our
systemsinput follow a different file or flake:Alternatively, instead of users listing systems in a local file, they
can use an external flake, e.g.:
github:nix-systems/defaultgithub:nix-systems/default-linuxgithub:nix-systems/default-darwingithub:nix-systems/aarch64-darwingithub:nix-systems/aarch64-linuxgithub:nix-systems/x86_64-darwingithub:nix-systems/x86_64-linuxSee https://github.com/nix-systems/nix-systems