1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2024-12-14 11:47:31 +00:00
flake-parts/modules/nixpkgs.nix

27 lines
822 B
Nix
Raw Permalink Normal View History

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 = {
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
);
};
};
};
}