From 71967c47e54c56557c0ee7bec7fe554c018e37c4 Mon Sep 17 00:00:00 2001 From: Leon Schuermann Date: Wed, 25 Sep 2024 01:51:22 -0400 Subject: [PATCH] nixos/syncoid: allow interval to be list of strings The syncoid module generates systemd services with a `startAt` config based on its `interval` value. However, it is currently not possible to completely disable this timer, or set multiple `startAt` values. By accepting the same types that `systemd.services..startAt` accepts, we can disable generating a timer unit or set multiple `startAt` timers. --- nixos/modules/services/backup/syncoid.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/backup/syncoid.nix b/nixos/modules/services/backup/syncoid.nix index 0d379f6c915d..8b4c59155f4d 100644 --- a/nixos/modules/services/backup/syncoid.nix +++ b/nixos/modules/services/backup/syncoid.nix @@ -106,14 +106,17 @@ in package = lib.mkPackageOption pkgs "sanoid" { }; interval = lib.mkOption { - type = lib.types.str; + type = with lib.types; either str (listOf str); default = "hourly"; example = "*-*-* *:15:00"; description = '' Run syncoid at this interval. The default is to run hourly. - The format is described in - {manpage}`systemd.time(7)`. + Must be in the format described in {manpage}`systemd.time(7)`. This is + equivalent to adding a corresponding timer unit with + {option}`OnCalendar` set to the value given here. + + Set to an empty list to avoid starting syncoid automatically. ''; };