1
0
forked from clan/clan-core

Merge pull request 'reference docs: add missing description fields and enforce it from now on' (#1704) from DavHau/clan-core:DavHau-dave into main

This commit is contained in:
clan-bot 2024-07-04 06:38:15 +00:00
commit d9c8079eae
6 changed files with 37 additions and 14 deletions

View File

@ -91,6 +91,7 @@ in
options.clan.postgresql = {
# we are reimplemeting ensureDatabase and ensureUser options here to allow to create databases with options
databases = lib.mkOption {
description = "Databases to create";
default = { };
type = lib.types.attrsOf (
lib.types.submodule (
@ -114,6 +115,7 @@ in
description = "Create the database if it does not exist.";
};
create.options = lib.mkOption {
description = "Options to pass to the CREATE DATABASE command.";
type = lib.types.lazyAttrsOf lib.types.str;
default = { };
example = {
@ -135,12 +137,14 @@ in
);
};
users = lib.mkOption {
description = "Users to create";
default = { };
type = lib.types.attrsOf (
lib.types.submodule (
{ name, ... }:
{
options.name = lib.mkOption {
description = "User name";
type = lib.types.str;
default = name;
};

View File

@ -7,6 +7,10 @@
{
options.clan.syncthing = {
id = lib.mkOption {
description = ''
The ID of the machine.
It is generated automatically by default.
'';
type = lib.types.nullOr lib.types.str;
example = "BABNJY4-G2ICDLF-QQEG7DD-N3OBNGF-BCCOFK6-MV3K7QJ-2WUZHXS-7DTW4AS";
default = config.clan.core.facts.services.syncthing.public."syncthing.pub".value or null;

View File

@ -30,7 +30,7 @@ let
options:
pkgs.nixosOptionsDoc {
options = options;
warningsAreErrors = false;
warningsAreErrors = true;
};
# clanModules docs

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.
'';
};
};
}