reference docs: add missing description fields and enforce it from now on

This commit is contained in:
DavHau
2024-07-04 13:32:57 +07:00
parent 0a4abd0e46
commit 208021ee1c
6 changed files with 37 additions and 14 deletions

View File

@@ -67,9 +67,19 @@
publicDirectory = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = ''
The directory where public facts are stored.
'';
};
services = lib.mkOption {
description = ''
Services to generate secrets and facts for.
Each service can have a generator script which generates the secrets and facts.
The generator script is expected to generate all secrets and facts defined for this service.
A `service` does not need to ba analogous to a systemd service, it can be any group of facts and secrets that need to be generated together.
'';
default = { };
type = lib.types.attrsOf (
lib.types.submodule (service: {
@@ -82,6 +92,9 @@
'';
};
generator = lib.mkOption {
description = ''
The generator to generate the secrets and facts for this service.
'';
type = lib.types.submodule (
{ config, ... }:
{
@@ -151,6 +164,9 @@
);
};
secret = lib.mkOption {
description = ''
Secret facts to generate for this service.
'';
default = { };
type = lib.types.attrsOf (
lib.types.submodule (secret: {
@@ -182,11 +198,11 @@
};
})
);
description = ''
path where the secret is located in the filesystem
'';
};
public = lib.mkOption {
description = ''
Public facts to generate for this service.
'';
default = { };
type = lib.types.attrsOf (
lib.types.submodule (fact: {
@@ -208,6 +224,9 @@
config.clan.core.clanDir + "/machines/${config.clan.core.machineName}/facts/${fact.config.name}";
};
value = lib.mkOption {
description = ''
The value of the public fact.
'';
defaultText = lib.literalExpression "\${config.clan.core.clanDir}/\${fact.config.path}";
type = lib.types.nullOr lib.types.str;
default =
@@ -231,15 +250,5 @@
./public/in_repo.nix
./public/vm.nix
# (lib.mkRenamedOptionModule
# [
# "clanCore"
# ]
# [
# "clan"
# "core"
# ]
# )
];
}

View File

@@ -7,6 +7,9 @@
{
# interface
options.clan.core.state = lib.mkOption {
description = ''
Define state directories to backup and restore
'';
default = { };
type = lib.types.attrsOf (
lib.types.submodule (

View File

@@ -64,6 +64,9 @@
publicDirectory = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = ''
The directory where public facts are stored.
'';
};
};
}