diff --git a/checks/nixos-documentation/flake-module.nix b/checks/nixos-documentation/flake-module.nix index 80564e521..743d97c19 100644 --- a/checks/nixos-documentation/flake-module.nix +++ b/checks/nixos-documentation/flake-module.nix @@ -6,6 +6,8 @@ let documentation.nixos.enable = true; documentation.nixos.extraModules = [ self.nixosModules.clanCore + # This is the only option that is not part of the + # module because it is usually set by flake-parts { clan.core.clanDir = ./.; } ]; }; diff --git a/nixosModules/clanCore/inventory/interface.nix b/nixosModules/clanCore/inventory/interface.nix index 895a15994..ddddd9fd5 100644 --- a/nixosModules/clanCore/inventory/interface.nix +++ b/nixosModules/clanCore/inventory/interface.nix @@ -14,22 +14,49 @@ let # }; # } instanceOptions = lib.types.submodule { - options.roles = lib.mkOption { type = lib.types.attrsOf machinesList; }; + options.roles = lib.mkOption { + description = '' + Configuration for a service instance. + + Specific roles describe the membership of foreign machines. + + ```nix + { # Configuration for an instance + roles..machines = [ # List of machines ]; + } + ``` + ''; + + type = lib.types.attrsOf machinesList; + }; }; - # { - # machines = [ - # "camina_machine" - # "vi_machine" - # "vyr_machine" - # ]; - # } machinesList = lib.types.submodule { - options.machines = lib.mkOption { type = lib.types.listOf lib.types.str; }; + options.machines = lib.mkOption { + description = '' + List of machines that are part of a role. + + ```nix + { # Configuration for an instance + roles..machines = [ # List of machines ]; + } + ``` + ''; + type = lib.types.listOf lib.types.str; + }; }; in { options.clan.inventory.services = lib.mkOption { + description = '' + Configuration for each inventory service. + + Each service can have multiple instances as follows: + + ``` + {serviceName}.{instancename} = { # Configuration for an instance } + ``` + ''; type = lib.types.attrsOf (lib.types.attrsOf instanceOptions); }; } diff --git a/nixosModules/clanCore/meta/interface.nix b/nixosModules/clanCore/meta/interface.nix index aef373d57..6a01ad56f 100644 --- a/nixosModules/clanCore/meta/interface.nix +++ b/nixosModules/clanCore/meta/interface.nix @@ -3,7 +3,16 @@ let optStr = lib.types.nullOr lib.types.str; in { - options.clan.meta.name = lib.mkOption { type = lib.types.str; }; - options.clan.meta.description = lib.mkOption { type = optStr; }; - options.clan.meta.icon = lib.mkOption { type = optStr; }; + options.clan.meta.name = lib.mkOption { + description = "The name of the clan"; + type = lib.types.str; + }; + options.clan.meta.description = lib.mkOption { + description = "The description of the clan"; + type = optStr; + }; + options.clan.meta.icon = lib.mkOption { + description = "The location of the clan icon"; + type = optStr; + }; }