Merge pull request 'backups: add clanCore backup & clan borgbackup module' (#605) from lassulus-backups into main

This commit is contained in:
clan-bot
2023-12-04 16:51:33 +00:00
10 changed files with 234 additions and 15 deletions

View File

@@ -3,15 +3,22 @@
options.clanCore.state = lib.mkOption {
default = { };
type = lib.types.attrsOf
(lib.types.submodule ({ name, ... }: {
(lib.types.submodule ({ ... }: {
options = {
folder = lib.mkOption {
type = lib.types.str;
default = name;
folders = lib.mkOption {
type = lib.types.listOf lib.types.str;
description = ''
Folder where state resides in
'';
};
restoreScript = lib.mkOption {
type = lib.types.str;
default = ":";
description = ''
script to restore the service after the state dir was restored from a backup
'';
};
};
}));
};
@@ -32,10 +39,11 @@
script to list backups
'';
};
delete = lib.mkOption {
restore = lib.mkOption {
type = lib.types.str;
description = ''
script to delete a backup
script to restore a backup
should take an optional service name as argument
'';
};
start = lib.mkOption {

View File

@@ -147,6 +147,8 @@ in
--network-id "$facts/zerotier-network-id"
'';
};
clanCore.state.zerotier.folders = [ "/var/lib/zerotier-one" ];
environment.systemPackages = [ config.clanCore.clanPkgs.zerotier-members ];
})
(lib.mkIf (config.clanCore.secretsUploadDirectory != null && !cfg.controller.enable && cfg.networkId != null) {