···159159 which the prune will occur.
160160 '';
161161 };
162162+163163+ randomizedDelaySec = mkOption {
164164+ default = "0";
165165+ type = types.singleLineStr;
166166+ example = "45min";
167167+ description = ''
168168+ Add a randomized delay before each auto prune.
169169+ The delay will be chosen between zero and this value.
170170+ This value must be a time span in the format specified by
171171+ {manpage}`systemd.time(7)`
172172+ '';
173173+ };
174174+175175+ persistent = mkOption {
176176+ default = true;
177177+ type = types.bool;
178178+ example = false;
179179+ description = ''
180180+ Takes a boolean argument. If true, the time when the service
181181+ unit was last triggered is stored on disk. When the timer is
182182+ activated, the service unit is triggered immediately if it
183183+ would have been triggered at least once during the time when
184184+ the timer was inactive. Such triggering is nonetheless
185185+ subject to the delay imposed by RandomizedDelaySec=. This is
186186+ useful to catch up on missed runs of the service when the
187187+ system was powered down.
188188+ '';
189189+ };
162190 };
163191164192 package = mkPackageOption pkgs "docker" { };
···252280 startAt = optional cfg.autoPrune.enable cfg.autoPrune.dates;
253281 after = [ "docker.service" ];
254282 requires = [ "docker.service" ];
283283+ };
284284+285285+ systemd.timers.docker-prune = mkIf cfg.autoPrune.enable {
286286+ timerConfig = {
287287+ RandomizedDelaySec = cfg.autoPrune.randomizedDelaySec;
288288+ Persistent = cfg.autoPrune.persistent;
289289+ };
255290 };
256291257292 assertions = [