backups: add clanCore backup & clan borgbackup module
This commit is contained in:
55
nixosModules/clanCore/backups.nix
Normal file
55
nixosModules/clanCore/backups.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
{ lib, ... }:
|
||||
{
|
||||
options.clanCore.state = lib.mkOption {
|
||||
default = { };
|
||||
type = lib.types.attrsOf
|
||||
(lib.types.submodule ({ name, ... }: {
|
||||
options = {
|
||||
folder = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = name;
|
||||
description = ''
|
||||
Folder where state resides in
|
||||
'';
|
||||
};
|
||||
};
|
||||
}));
|
||||
};
|
||||
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
|
||||
'';
|
||||
};
|
||||
delete = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
script to delete a backup
|
||||
'';
|
||||
};
|
||||
start = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
script to start a backup
|
||||
'';
|
||||
};
|
||||
};
|
||||
}));
|
||||
default = [ ];
|
||||
description = ''
|
||||
Configured backup providers which are used by this machine
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
{ self, inputs, lib, ... }: {
|
||||
flake.nixosModules.clanCore = { config, pkgs, options, ... }: {
|
||||
imports = [
|
||||
./backups.nix
|
||||
./clan-imports
|
||||
./secrets
|
||||
./zerotier
|
||||
|
||||
Reference in New Issue
Block a user