restic: Simplify timerConfig
The upstream restic module validates the types anyway, so I can drop the ugly expression to copy the option.
This commit is contained in:
parent
6a8904011a
commit
d7272e9db3
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, config, lib, options, ... }:
|
{ pkgs, config, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.sbruder.restic;
|
cfg = config.sbruder.restic;
|
||||||
|
|
||||||
|
@ -41,15 +41,8 @@ in
|
||||||
{
|
{
|
||||||
options.sbruder.restic = {
|
options.sbruder.restic = {
|
||||||
enable = lib.mkEnableOption "restic";
|
enable = lib.mkEnableOption "restic";
|
||||||
timerConfig = lib.recursiveUpdate
|
timerConfig = lib.mkOption {
|
||||||
((lib.elemAt
|
type = with lib.types; attrsOf str;
|
||||||
(lib.elemAt
|
|
||||||
options.services.restic.backups.type.getSubModules
|
|
||||||
0
|
|
||||||
).imports
|
|
||||||
0)
|
|
||||||
{ name = ""; }).options.timerConfig
|
|
||||||
{
|
|
||||||
default = {
|
default = {
|
||||||
OnCalendar = "20:00";
|
OnCalendar = "20:00";
|
||||||
RandomizedDelaySec = "2h";
|
RandomizedDelaySec = "2h";
|
||||||
|
@ -74,6 +67,7 @@ in
|
||||||
|
|
||||||
services.restic.backups.system = {
|
services.restic.backups.system = {
|
||||||
inherit repository;
|
inherit repository;
|
||||||
|
inherit (cfg) timerConfig;
|
||||||
passwordFile = config.krops.secrets.restic-password.path;
|
passwordFile = config.krops.secrets.restic-password.path;
|
||||||
s3CredentialsFile = config.krops.secrets.restic-s3.path;
|
s3CredentialsFile = config.krops.secrets.restic-s3.path;
|
||||||
paths = [
|
paths = [
|
||||||
|
@ -87,7 +81,6 @@ in
|
||||||
"--exclude-file=${excludesFile}"
|
"--exclude-file=${excludesFile}"
|
||||||
"--verbose"
|
"--verbose"
|
||||||
];
|
];
|
||||||
timerConfig = cfg.timerConfig;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services."restic-backups-system".serviceConfig = {
|
systemd.services."restic-backups-system".serviceConfig = {
|
||||||
|
|
Loading…
Reference in a new issue