2023-11-23 14:43:25 +00:00
|
|
|
{ lib, ... }:
|
|
|
|
{
|
2024-03-17 18:48:49 +00:00
|
|
|
imports = [ ./state.nix ];
|
2023-11-23 14:43:25 +00:00
|
|
|
options.clanCore.backups = {
|
|
|
|
providers = lib.mkOption {
|
2024-03-17 18:48:49 +00:00
|
|
|
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 = ''
|
2024-03-20 06:13:01 +00:00
|
|
|
Command to list backups.
|
2024-03-17 18:48:49 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
restore = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
|
|
|
description = ''
|
2024-03-20 06:13:01 +00:00
|
|
|
Command to restore a backup.
|
|
|
|
The name of the backup and the folders to restore will be
|
|
|
|
set as environment variables NAME and FOLDERS respectively.
|
2024-03-17 18:48:49 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
create = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
|
|
|
description = ''
|
2024-03-20 06:13:01 +00:00
|
|
|
Command to start a backup
|
2024-03-17 18:48:49 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
)
|
|
|
|
);
|
2023-12-06 16:12:38 +00:00
|
|
|
default = { };
|
2023-11-23 14:43:25 +00:00
|
|
|
description = ''
|
|
|
|
Configured backup providers which are used by this machine
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|