Compare commits
2 commits
56be71eec3
...
6aa131b7d1
Author | SHA1 | Date | |
---|---|---|---|
6aa131b7d1 | |||
8242736d16 |
1 changed files with 3 additions and 22 deletions
|
@ -1,9 +1,11 @@
|
|||
{ config, lib, pkgs, utils, ... }: let
|
||||
{ config, lib, options, pkgs, ... }: let
|
||||
cfg = config.kyouma.restic;
|
||||
in {
|
||||
options.kyouma.restic = let
|
||||
inherit (lib) mkOption types;
|
||||
in {
|
||||
inherit (options.services.restic.backups.type.getSubOptions [])
|
||||
timerConfig backupPrepareCommand backupCleanupCommand;
|
||||
enable = lib.mkEnableOption "Enable restic backup";
|
||||
paths = mkOption {
|
||||
description = "paths to backup";
|
||||
|
@ -40,27 +42,6 @@ in {
|
|||
type = types.nonEmptyStr;
|
||||
default = "${config.networking.hostName}-backup";
|
||||
};
|
||||
timerConfig = mkOption {
|
||||
description = "timer config";
|
||||
type = with types; nullOr (attrsOf utils.systemdUtils.unitOptions.unitOption);
|
||||
default = {
|
||||
OnCalendar = "daily";
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
|
||||
# FIXME: Can these be just inherited?
|
||||
backupPrepareCommand = mkOption {
|
||||
description = "preparation script";
|
||||
type = with types; nullOr str;
|
||||
default = null;
|
||||
};
|
||||
|
||||
backupCleanupCommand = mkOption {
|
||||
description = "cleanup script";
|
||||
type = with types; nullOr str;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
sops.secrets."restic/${cfg.remoteUser}/password" = {
|
||||
|
|
Loading…
Reference in a new issue