checks: add check for rendering docs
All checks were successful
checks / check-links (pull_request) Successful in 15s
checks / checks-impure (pull_request) Successful in 1m52s
checks / checks (pull_request) Successful in 3m32s

This commit is contained in:
DavHau 2024-03-25 14:44:39 +07:00
parent d59673e89a
commit 3771be2110
4 changed files with 14 additions and 1 deletions

View File

@ -16,6 +16,15 @@
{
checks =
let
# ensure all options can be rendered after importing clan into nixos
renderClanOptions =
let
docs = pkgs.nixosOptionsDoc {
options = (pkgs.nixos { imports = [ self.nixosModules.clanCore ]; }).options;
warningsAreErrors = false;
};
in
docs.optionsJSON;
nixosTestArgs = {
# reference to nixpkgs for the current system
inherit pkgs;
@ -45,7 +54,7 @@
self'.legacyPackages.homeConfigurations or { }
);
in
nixosTests // schemaTests // flakeOutputs;
{ inherit renderClanOptions; } // nixosTests // schemaTests // flakeOutputs;
legacyPackages = {
nixosTests =
let

View File

@ -7,5 +7,6 @@ in
type = lib.types.attrs;
description = "The json schema for the .clan options namespace";
default = jsonschema.parseOptions options.clan;
defaultText = lib.literalExpression "jsonschema.schemaToJSON options.clan";
};
}

View File

@ -135,6 +135,7 @@
path to a secret which is generated by the generator
'';
default = "${config'.clanCore.secretsDirectory}/${config'.clanCore.secretsPrefix}${config.name}";
defaultText = lib.literalExpression "\${config'.clanCore.secretsDirectory}/\${config'.clanCore.secretsPrefix}\${config.name}";
};
}
// lib.optionalAttrs (config'.clanCore.secretStore == "sops") {
@ -173,6 +174,7 @@
default =
config.clanCore.clanDir
+ "/machines/${config.clanCore.machineName}/facts/${fact.config._module.args.name}";
defaultText = lib.literalExpression "\${config.clanCore.clanDir}/machines/\${config.clanCore.machineName}/facts/\${fact.config._module.args.name}";
};
value = lib.mkOption {
defaultText = lib.literalExpression "\${config.clanCore.clanDir}/\${fact.config.path}";

View File

@ -24,6 +24,7 @@ in
name = lib.mkOption {
type = lib.types.str;
default = config.clanCore.clanName;
defaultText = "config.clanCore.clanName";
description = ''
zerotier network name
'';