Merge pull request 'Flake: nixos-facter-module with flake: false' (#1986) from hsjobeki/clan-core:hsjobeki-main into main
This commit is contained in:
@@ -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.<roleName>.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.<roleName>.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);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -45,8 +45,11 @@
|
||||
};
|
||||
clanDir = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
# TODO: @DavHau: before we can remove this, we need to make sure that Palo's config case works
|
||||
default = ./.;
|
||||
# documentation.nixos.extraModules = [
|
||||
# ...
|
||||
# clan-core.nixosModules.clanCore
|
||||
# { clan.core.clanDir = ./path/to/flake; }
|
||||
# ];
|
||||
description = ''
|
||||
the location of the flake repo, used to calculate the location of facts and secrets
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user