Move options to seperate modules so they can be shared between home manager and nixos
This commit is contained in:
@@ -8,52 +8,6 @@ with lib; let
|
||||
cfg = config.simmer.backup;
|
||||
in
|
||||
{
|
||||
options.simmer.backup = {
|
||||
enable = mkOption {
|
||||
description = "Whether backups should be enabled";
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
repo = mkOption {
|
||||
description = "Which repository to backup to";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
paths = mkOption {
|
||||
description = "Which paths to backup";
|
||||
type = types.listOf types.str;
|
||||
};
|
||||
|
||||
user = mkOption {
|
||||
description = "Which user to run backup commands with";
|
||||
type = types.str;
|
||||
default = "root";
|
||||
};
|
||||
|
||||
excludes = mkOption {
|
||||
description = "Which directories to exclude";
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
};
|
||||
|
||||
passphrase = mkOption {
|
||||
description = "Path to file containing passphrase";
|
||||
type = types.path;
|
||||
};
|
||||
|
||||
key = mkOption {
|
||||
description = "Path to file containing SSH Key";
|
||||
type = types.path;
|
||||
};
|
||||
|
||||
repeat = mkOption {
|
||||
description = "How often to run the backup (hourly, daily, weekly)";
|
||||
type = types.enum [ "hourly" "daily" "weekly" ];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.borgbackup.jobs = {
|
||||
backup = {
|
||||
|
||||
Reference in New Issue
Block a user