Compare commits

..

2 commits

View file

@ -1,11 +1,9 @@
{ config, lib, options, pkgs, ... }: let
{ config, lib, pkgs, utils, ... }: 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";
@ -42,6 +40,27 @@ 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" = {