nix-optimise: only create timer unit if needed

This commit is contained in:
r-vdp 2024-01-30 19:04:26 +01:00
parent 004318a239
commit 9f2a705f7f
No known key found for this signature in database
1 changed files with 5 additions and 3 deletions

View File

@ -42,9 +42,11 @@ in
startAt = lib.optionals cfg.automatic cfg.dates;
};
timers.nix-optimise.timerConfig = {
Persistent = true;
RandomizedDelaySec = 1800;
timers.nix-optimise = lib.mkIf cfg.automatic {
timerConfig = {
Persistent = true;
RandomizedDelaySec = 1800;
};
};
};
};