node inheritance + group parsing
This commit is contained in:
parent
d891a92357
commit
f819933c8d
12 changed files with 422 additions and 253 deletions
|
|
@ -1,49 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
revInfo ? "",
|
||||
}: let
|
||||
inherit
|
||||
(lib)
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
|
||||
# A best effort, lenient estimate. Please use a recent nixpkgs lib if you
|
||||
# override it at all.
|
||||
minVersion = "23.05pre-git";
|
||||
|
||||
isNixpkgsValidVersion =
|
||||
(builtins.compareVersions lib.version minVersion < 0)
|
||||
# XXX: TODO: make this message snow specific
|
||||
|| abort ''
|
||||
The nixpkgs-lib dependency of flake-parts was overridden but is too old.
|
||||
The minimum supported version of nixpkgs-lib is ${minVersion},
|
||||
but the actual version is ${lib.version}${revInfo}.
|
||||
'';
|
||||
in
|
||||
assert isNixpkgsValidVersion; {
|
||||
# Helper function for defining a per-system option that
|
||||
# gets transposed by the usual flake system logic to a
|
||||
# top-level outputs attribute.
|
||||
mkPerSystemFlakeOutput = {
|
||||
name,
|
||||
option,
|
||||
file,
|
||||
}: {
|
||||
_file = file;
|
||||
|
||||
options = {
|
||||
outputs.${name} = mkOption {
|
||||
type = types.attrsWith {
|
||||
elemType = option.type;
|
||||
lazy = true;
|
||||
placeholder = "system";
|
||||
};
|
||||
default = {};
|
||||
description = ''
|
||||
See {option}`perSystem.${name}` for description and examples.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue