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 = checks =
let 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 = { nixosTestArgs = {
# reference to nixpkgs for the current system # reference to nixpkgs for the current system
inherit pkgs; inherit pkgs;
@ -45,7 +54,7 @@
self'.legacyPackages.homeConfigurations or { } self'.legacyPackages.homeConfigurations or { }
); );
in in
nixosTests // schemaTests // flakeOutputs; { inherit renderClanOptions; } // nixosTests // schemaTests // flakeOutputs;
legacyPackages = { legacyPackages = {
nixosTests = nixosTests =
let let

View File

@ -7,5 +7,6 @@ in
type = lib.types.attrs; type = lib.types.attrs;
description = "The json schema for the .clan options namespace"; description = "The json schema for the .clan options namespace";
default = jsonschema.parseOptions options.clan; 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 path to a secret which is generated by the generator
''; '';
default = "${config'.clanCore.secretsDirectory}/${config'.clanCore.secretsPrefix}${config.name}"; 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") { // lib.optionalAttrs (config'.clanCore.secretStore == "sops") {
@ -173,6 +174,7 @@
default = default =
config.clanCore.clanDir config.clanCore.clanDir
+ "/machines/${config.clanCore.machineName}/facts/${fact.config._module.args.name}"; + "/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 { value = lib.mkOption {
defaultText = lib.literalExpression "\${config.clanCore.clanDir}/\${fact.config.path}"; defaultText = lib.literalExpression "\${config.clanCore.clanDir}/\${fact.config.path}";

View File

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