nix-gc: add persistent
option (#5490)
Mirrors the `nix.gc.persistent` option in nixpkgs: https://search.nixos.org/options?channel=unstable&show=nix.gc.persistent&from=0&size=50&sort=relevance&type=packages&query=nix.gc.persistent
This commit is contained in:
parent
9b53a10f4c
commit
83bfe1bac8
|
@ -90,6 +90,18 @@ in {
|
||||||
garbage collector is run automatically.
|
garbage collector is run automatically.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
persistent = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
example = false;
|
||||||
|
description = ''
|
||||||
|
If true, the time when the service unit was last triggered is
|
||||||
|
stored on disk. When the timer is activated, the service unit is
|
||||||
|
triggered immediately if it would have been triggered at least once
|
||||||
|
during the time when the timer was inactive.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -107,6 +119,7 @@ in {
|
||||||
Unit = { Description = "Nix Garbage Collector"; };
|
Unit = { Description = "Nix Garbage Collector"; };
|
||||||
Timer = {
|
Timer = {
|
||||||
OnCalendar = "${cfg.frequency}";
|
OnCalendar = "${cfg.frequency}";
|
||||||
|
Persistent = cfg.persistent;
|
||||||
Unit = "nix-gc.service";
|
Unit = "nix-gc.service";
|
||||||
};
|
};
|
||||||
Install = { WantedBy = [ "timers.target" ]; };
|
Install = { WantedBy = [ "timers.target" ]; };
|
||||||
|
|
|
@ -3,6 +3,7 @@ WantedBy=timers.target
|
||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
OnCalendar=monthly
|
OnCalendar=monthly
|
||||||
|
Persistent=true
|
||||||
Unit=nix-gc.service
|
Unit=nix-gc.service
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
|
|
Loading…
Reference in a new issue