Expose the eachDefaultSystemPassThrough and eachSystemPassThrough
functions to handle cases where the system key should not be injected by
eachDefaultSystem and eachSystem:
inputs.flake-utils.lib.eachDefaultSystem (system: {
checks./*<SYSTEM>.*/"<CHECK>" = /* ... */;
devShells./*<SYSTEM>.*/"<DEV_SHELL>" = /* ... */;
packages./*<SYSTEM>.*/"<PACKAGE>" = /* ... */;
})
// inputs.flake-utils.lib.eachDefaultSystemPassThrough (system: {
homeConfigurations."<HOME_CONFIGURATION>" = /* ... */;
nixosConfigurations."<NIXOS_CONFIGURATION>" = /* ... */;
})
These functions prevent users from re-implementing simplified
eachDefaultSystem and eachSystem versions to avoid system key
injections, while benefiting from current and future complex logic, like
handling the '--impure' flag.
This addresses flake-utils' arguably biggest issue. [1]
[1]: https://ayats.org/blog/no-flake-utils
Meld allows you to break up a Nix Flake into parts while using the
same inputs across all of them. This is useful for splitting up large
flakes which are common in monorepos.
The flake design makes it unecessary hard to adopt new platforms
by hardcoding system. By having this list ready to use, I hope
people will write more portable flakes.