remove some references to config in options
This commit is contained in:
@@ -9,7 +9,7 @@ in
|
||||
options.clan.borgbackup-static = {
|
||||
excludeMachines = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
example = [ config.clan.core.settings.machine.name ];
|
||||
example = lib.literalExpression "[ config.clan.core.settings.machine.name ]";
|
||||
default = [ ];
|
||||
description = ''
|
||||
Machines that should not be backuped.
|
||||
@@ -20,7 +20,7 @@ in
|
||||
};
|
||||
includeMachines = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
example = [ config.clan.core.settings.machine.name ];
|
||||
example = lib.literalExpression "[ config.clan.core.settings.machine.name ]";
|
||||
default = [ ];
|
||||
description = ''
|
||||
Machines that should be backuped.
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
[ ]
|
||||
else
|
||||
[ config.clan.core.settings.machine.name ];
|
||||
defaultText = lib.literalExpression ''
|
||||
if config.clan.static-hosts.topLevelDomain != "" then
|
||||
[ ]
|
||||
else
|
||||
[ config.clan.core.settings.machine.name ];
|
||||
'';
|
||||
description = "Hosts that should be excluded";
|
||||
};
|
||||
topLevelDomain = lib.mkOption {
|
||||
|
||||
@@ -48,7 +48,7 @@ in
|
||||
options.clan.syncthing-static-peers = {
|
||||
excludeMachines = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
example = [ config.clan.core.settings.machine.name ];
|
||||
example = lib.literalExpression "[ config.clan.core.settings.machine.name ]";
|
||||
default = [ ];
|
||||
description = ''
|
||||
Machines that should not be added.
|
||||
|
||||
@@ -28,6 +28,7 @@ in
|
||||
excludeHosts = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ config.clan.core.settings.machine.name ];
|
||||
defaultText = lib.literalExpression "[ config.clan.core.settings.machine.name ]";
|
||||
description = "Hosts that should be excluded";
|
||||
};
|
||||
networkIps = lib.mkOption {
|
||||
|
||||
@@ -35,6 +35,7 @@ in
|
||||
excludeHosts = lib.mkOption {
|
||||
type = listOf str;
|
||||
default = [ config.clan.core.settings.machine.name ];
|
||||
defaultText = lib.literalExpression "[ config.clan.core.settings.machine.name ]";
|
||||
description = "Hosts that should be excluded";
|
||||
};
|
||||
networkIps = lib.mkOption {
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = name;
|
||||
defaultText = "attribute name of the backup provider";
|
||||
description = ''
|
||||
Name of the backup provider
|
||||
'';
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = service.config._module.args.name;
|
||||
defaultText = "attribute name of the service";
|
||||
description = ''
|
||||
Namespace of the service
|
||||
'';
|
||||
@@ -97,6 +98,7 @@
|
||||
name of the secret
|
||||
'';
|
||||
default = secret.config._module.args.name;
|
||||
defaultText = "attribute name of the secret";
|
||||
};
|
||||
path = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
@@ -111,6 +113,7 @@
|
||||
groups = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = config.clan.core.sops.defaultGroups;
|
||||
defaultText = lib.literalExpression "config.clan.core.sops.defaultGroups";
|
||||
description = ''
|
||||
Groups to decrypt the secret for. By default we always use the user's key.
|
||||
'';
|
||||
@@ -133,6 +136,7 @@
|
||||
name of the fact
|
||||
'';
|
||||
default = fact.config._module.args.name;
|
||||
defaultText = "attribute name of the fact";
|
||||
};
|
||||
path = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
@@ -145,10 +149,10 @@
|
||||
defaultText = lib.literalExpression "\${config.clan.core.settings.directory}/machines/\${config.clan.core.settings.machine.name}/facts/\${fact.config._module.args.name}";
|
||||
};
|
||||
value = lib.mkOption {
|
||||
defaultText = lib.literalExpression "\${config.clan.core.settings.directory}/\${fact.config.path}";
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default =
|
||||
if builtins.pathExists fact.config.path then lib.strings.fileContents fact.config.path else null;
|
||||
defaultText = "null if fact.config.path does not exist, else the content of the file";
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = service.config._module.args.name;
|
||||
defaultText = "attribute name of the service";
|
||||
description = ''
|
||||
Namespace of the service
|
||||
'';
|
||||
@@ -178,6 +179,7 @@
|
||||
name of the secret
|
||||
'';
|
||||
default = secret.config._module.args.name;
|
||||
defaultText = "attribute name of the secret";
|
||||
};
|
||||
path = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
@@ -185,12 +187,14 @@
|
||||
path to a secret which is generated by the generator
|
||||
'';
|
||||
default = config.clan.core.facts.secretPathFunction secret;
|
||||
defaultText = lib.literalExpression "config.clan.core.facts.secretPathFunction secret";
|
||||
};
|
||||
}
|
||||
// lib.optionalAttrs (config.clan.core.facts.secretModule == "clan_cli.facts.secret_modules.sops") {
|
||||
groups = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = config.clan.core.sops.defaultGroups;
|
||||
defaultText = lib.literalExpression "config.clan.core.sops.defaultGroups";
|
||||
description = ''
|
||||
Groups to decrypt the secret for. By default we always use the user's key.
|
||||
'';
|
||||
@@ -213,6 +217,7 @@
|
||||
name of the public fact
|
||||
'';
|
||||
default = fact.config._module.args.name;
|
||||
defaultText = "attribute name of the public fact";
|
||||
};
|
||||
path = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
|
||||
@@ -95,7 +95,7 @@ in
|
||||
description = ''
|
||||
the name of the clan
|
||||
'';
|
||||
# Set by the flake, so it's read-only in the maschine
|
||||
# Set by the flake, so it's read-only in the machine
|
||||
readOnly = true;
|
||||
};
|
||||
icon = lib.mkOption {
|
||||
@@ -103,7 +103,7 @@ in
|
||||
description = ''
|
||||
the location of the clan icon
|
||||
'';
|
||||
# Set by the flake, so it's read-only in the maschine
|
||||
# Set by the flake, so it's read-only in the machine
|
||||
readOnly = true;
|
||||
};
|
||||
machine = mkOption {
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
name = lib.mkOption {
|
||||
type = lib.types.strMatching "^[a-zA-Z0-9_-]+$";
|
||||
default = name;
|
||||
defaultText = "attribute name of the state";
|
||||
description = ''
|
||||
Name of the state
|
||||
'';
|
||||
@@ -43,6 +44,7 @@
|
||||
preBackupCommand = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = if config.preBackupScript == null then null else "pre-backup-${name}";
|
||||
defaultText = lib.literalExpression ''null if preBackupScript set, or else "pre-backup-${name}"'';
|
||||
readOnly = true;
|
||||
description = ''
|
||||
Use this command in backup providers. It contains the content of preBackupScript.
|
||||
@@ -73,6 +75,7 @@
|
||||
preRestoreCommand = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = if config.preRestoreScript == null then null else "pre-restore-${name}";
|
||||
defaultText = lib.literalExpression ''null if preRestoreScript set, or else "pre-restore-${name}"'';
|
||||
readOnly = true;
|
||||
description = ''
|
||||
This command can be called to restore the state dir from a backup.
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
command = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ (lib.getExe pkgs.foot) ];
|
||||
defaultText = "executable of pkgs.foot";
|
||||
description = "Commands that waypipe should run";
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user