forked from clan/clan-core
Merge pull request 'Add clan.borgbackup.exclude.' (#1790) from inventory-fixes into main
This commit is contained in:
commit
4d25118853
@ -106,6 +106,16 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
options.clan.borgbackup.exclude = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
example = [ "*.pyc" ];
|
||||
default = [ ];
|
||||
description = ''
|
||||
Directories/Files to exclude from the backup.
|
||||
Use * as a wildcard.
|
||||
'';
|
||||
};
|
||||
|
||||
imports = [
|
||||
(lib.mkRemovedOptionModule [
|
||||
"clan"
|
||||
@ -129,7 +139,7 @@ in
|
||||
paths = lib.unique (
|
||||
lib.flatten (map (state: state.folders) (lib.attrValues config.clan.core.state))
|
||||
);
|
||||
exclude = [ "*.pyc" ];
|
||||
exclude = cfg.exclude;
|
||||
repo = dest.repo;
|
||||
environment.BORG_RSH = dest.rsh;
|
||||
compression = "auto,zstd";
|
||||
|
@ -9,9 +9,9 @@
|
||||
users.users.root.hashedPasswordFile =
|
||||
config.clan.core.facts.services.root-password.secret.password-hash.path;
|
||||
|
||||
sops.secrets."${config.clan.core.machineName}-password-hash".neededForUsers = lib.mkIf (
|
||||
config.clan.core.facts.secretStore == "sops"
|
||||
) true;
|
||||
sops.secrets = lib.mkIf (config.clan.core.facts.secretStore == "sops") {
|
||||
"${config.clan.core.machineName}-password-hash".neededForUsers = true;
|
||||
};
|
||||
|
||||
clan.core.facts.services.root-password = {
|
||||
secret.password = { };
|
||||
|
@ -23,7 +23,11 @@
|
||||
users.mutableUsers = false;
|
||||
users.users.${config.clan.user-password.user}.hashedPasswordFile =
|
||||
config.clan.core.facts.services.user-password.secret.user-password-hash.path;
|
||||
sops.secrets."${config.clan.core.machineName}-user-password-hash".neededForUsers = true;
|
||||
|
||||
sops.secrets = lib.mkIf (config.clan.core.facts.secretStore == "sops") {
|
||||
"${config.clan.core.machineName}-user-password-hash".neededForUsers = true;
|
||||
};
|
||||
|
||||
clan.core.facts.services.user-password = {
|
||||
secret.user-password = { };
|
||||
secret.user-password-hash = { };
|
||||
|
@ -39,6 +39,7 @@ class BorgbackupConfigDestination:
|
||||
@dataclass
|
||||
class BorgbackupConfig:
|
||||
destinations: dict[str, BorgbackupConfigDestination] = field(default_factory = dict)
|
||||
exclude: list[str] = field(default_factory = list)
|
||||
|
||||
|
||||
@dataclass
|
||||
|
Loading…
Reference in New Issue
Block a user