clan-core/nixosModules/clanCore/backups.nix

50 lines
1.4 KiB
Nix
Raw Normal View History

{ lib, ... }:
{
imports = [
./state.nix
];
options.clanCore.backups = {
providers = lib.mkOption {
type = lib.types.attrsOf (lib.types.submodule ({ name, ... }: {
options = {
name = lib.mkOption {
type = lib.types.str;
default = name;
description = ''
Name of the backup provider
'';
};
list = lib.mkOption {
type = lib.types.str;
description = ''
script to list backups
'';
};
2023-12-04 16:05:37 +00:00
restore = lib.mkOption {
type = lib.types.str;
description = ''
2023-12-04 16:05:37 +00:00
script to restore a backup
should take an optional service name as argument
2023-12-08 17:40:18 +00:00
gets ARCHIVE_ID, LOCATION, JOB and FOLDERS as environment variables
ARCHIVE_ID is the id of the backup
LOCATION is the remote identifier of the backup
JOB is the job name of the backup
FOLDERS is a colon separated list of folders to restore
'';
};
2023-12-08 17:40:18 +00:00
create = lib.mkOption {
type = lib.types.str;
description = ''
script to start a backup
'';
};
};
}));
2023-12-06 16:12:38 +00:00
default = { };
description = ''
Configured backup providers which are used by this machine
'';
};
};
}