From f5bf638e5f13f92ee3eb3f130469d697cce62b75 Mon Sep 17 00:00:00 2001 From: Jure Varlec Date: Sun, 30 Apr 2023 16:13:23 +0200 Subject: [PATCH] nixos/fstrim: fix overriding the timer interval The OnCalendar systemd setting is additive. To clear the setting defined by the pre-existing unit file, it has to be set first to an empty string, then to the desired value. (cherry picked from commit 44438e0dcdf800809e1bf1bed78dea90bb35037a) --- nixos/modules/services/misc/fstrim.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/misc/fstrim.nix b/nixos/modules/services/misc/fstrim.nix index 36b5f9c8cca1..55fb24e29272 100644 --- a/nixos/modules/services/misc/fstrim.nix +++ b/nixos/modules/services/misc/fstrim.nix @@ -34,7 +34,7 @@ in { systemd.timers.fstrim = { timerConfig = { - OnCalendar = cfg.interval; + OnCalendar = [ "" cfg.interval ]; }; wantedBy = [ "timers.target" ]; };