grant run-time environments their own modules with their own description

This commit is contained in:
Kiara Grouwstra 2025-06-23 11:25:18 +02:00
parent c1f3aa6aed
commit fefcd93bc1
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU

View file

@ -4,12 +4,19 @@
...
}:
let
inherit (lib) attrNames mkOption genAttrs;
inherit (lib)
attrNames
mapAttrs
mkOption
genAttrs
;
inherit (lib.types)
attrsOf
attrTag
deferredModule
mergeTypes
submoduleWith
submodule
;
runtime-configuration = mkOption {
description = "The NixOS module of a run-time environment";
@ -21,26 +28,28 @@ let
runtime-environment = attrTag (
mapAttrs
(
name: options:
mkOption {
type = submoduleWith {
modules = [
{
options = options // {
module = mkOption {
name:
option@{ type, ... }:
mkOption (
option
// {
type = mergeTypes type (submodule {
options.module = mkOption {
description = "The NixOS module of the run-time environment";
type = deferredModule;
default = config.runtime-configurations.${name};
readOnly = true;
};
};
}
];
};
});
}
)
)
{
nixos = { };
nixos = {
description = "A NixOS instance to deploy to.";
type = submodule {
};
};
}
);
application = submoduleWith {