1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2025-03-16 21:38:24 +00:00

Move perSystem.packages into options

This commit is contained in:
Robert Hensing 2022-05-17 10:10:16 +02:00
parent fdd87732fd
commit 1c0f8f3036

View file

@ -9,6 +9,7 @@ let
; ;
inherit (flake-modules-core-lib) inherit (flake-modules-core-lib)
mkSubmoduleOptions mkSubmoduleOptions
mkPerSystemOption
; ;
in in
{ {
@ -23,6 +24,20 @@ in
''; '';
}; };
}; };
perSystem = mkPerSystemOption ({ config, ... }: {
_file = ./packages.nix;
options = {
packages = mkOption {
type = types.lazyAttrsOf types.package;
default = { };
description = ''
An attribute set of packages to be built by <literal>nix build .#&lt;name></literal>.
<literal>nix build .#&lt;name></literal> will build <literal>packages.&lt;name></literal>.
'';
};
};
});
}; };
config = { config = {
flake.packages = flake.packages =
@ -38,18 +53,5 @@ in
packages = flake.packages.${system}; packages = flake.packages.${system};
}; };
perSystem = system: { config, ... }: {
_file = ./packages.nix;
options = {
packages = mkOption {
type = types.lazyAttrsOf types.package;
default = { };
description = ''
An attribute set of packages to be built by <literal>nix build .#&lt;name></literal>.
<literal>nix build .#&lt;name></literal> will build <literal>packages.&lt;name></literal>.
'';
};
};
};
}; };
} }