2022-05-18 09:03:42 +00:00
|
|
|
#
|
|
|
|
# Nixpkgs module. The only exception to the rule.
|
|
|
|
#
|
|
|
|
# Provides a `pkgs` argument in `perSystem`.
|
|
|
|
#
|
2022-05-25 14:36:33 +00:00
|
|
|
# Arguably, this shouldn't be in flake-parts, but in nixpkgs.
|
2022-05-18 09:03:42 +00:00
|
|
|
# Nixpkgs could define its own module that does this, which would be
|
|
|
|
# a more consistent UX, but for now this will do.
|
|
|
|
#
|
|
|
|
# The existence of this module does not mean that other flakes' logic
|
2022-05-25 14:36:33 +00:00
|
|
|
# will be accepted into flake-parts, because it's against the
|
2022-05-18 09:03:42 +00:00
|
|
|
# spirit of Flakes.
|
|
|
|
#
|
|
|
|
{
|
|
|
|
config = {
|
2022-05-25 16:09:17 +00:00
|
|
|
perSystem = { inputs', lib, ... }: {
|
2022-05-18 09:03:42 +00:00
|
|
|
config = {
|
|
|
|
_module.args.pkgs = lib.mkOptionDefault (
|
|
|
|
builtins.seq
|
2022-05-25 14:36:33 +00:00
|
|
|
(inputs'.nixpkgs or (throw "flake-parts: The flake does not have a `nixpkgs` input. Please add it, or set `perSystem._module.args.pkgs` yourself."))
|
2022-05-18 09:03:42 +00:00
|
|
|
inputs'.nixpkgs.legacyPackages
|
|
|
|
);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|