forked from Fediversity/Fediversity
grant run-time environments their own modules with their own description
This commit is contained in:
parent
c1f3aa6aed
commit
fefcd93bc1
1 changed files with 28 additions and 19 deletions
|
@ -4,12 +4,19 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (lib) attrNames mkOption genAttrs;
|
inherit (lib)
|
||||||
|
attrNames
|
||||||
|
mapAttrs
|
||||||
|
mkOption
|
||||||
|
genAttrs
|
||||||
|
;
|
||||||
inherit (lib.types)
|
inherit (lib.types)
|
||||||
attrsOf
|
attrsOf
|
||||||
attrTag
|
attrTag
|
||||||
deferredModule
|
deferredModule
|
||||||
|
mergeTypes
|
||||||
submoduleWith
|
submoduleWith
|
||||||
|
submodule
|
||||||
;
|
;
|
||||||
runtime-configuration = mkOption {
|
runtime-configuration = mkOption {
|
||||||
description = "The NixOS module of a run-time environment";
|
description = "The NixOS module of a run-time environment";
|
||||||
|
@ -21,26 +28,28 @@ let
|
||||||
runtime-environment = attrTag (
|
runtime-environment = attrTag (
|
||||||
mapAttrs
|
mapAttrs
|
||||||
(
|
(
|
||||||
name: options:
|
name:
|
||||||
mkOption {
|
option@{ type, ... }:
|
||||||
type = submoduleWith {
|
mkOption (
|
||||||
modules = [
|
option
|
||||||
{
|
// {
|
||||||
options = options // {
|
type = mergeTypes type (submodule {
|
||||||
module = mkOption {
|
options.module = mkOption {
|
||||||
description = "The NixOS module of the run-time environment";
|
description = "The NixOS module of the run-time environment";
|
||||||
type = deferredModule;
|
type = deferredModule;
|
||||||
default = config.runtime-configurations.${name};
|
default = config.runtime-configurations.${name};
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
};
|
};
|
||||||
};
|
});
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
nixos = { };
|
nixos = {
|
||||||
|
description = "A NixOS instance to deploy to.";
|
||||||
|
type = submodule {
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
application = submoduleWith {
|
application = submoduleWith {
|
||||||
|
|
Loading…
Add table
Reference in a new issue