mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 03:29:45 +01:00
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
2 changed files with 14 additions and 0 deletions
|
@ -90,6 +90,18 @@ in {
|
|||
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"; };
|
||||
Timer = {
|
||||
OnCalendar = "${cfg.frequency}";
|
||||
Persistent = cfg.persistent;
|
||||
Unit = "nix-gc.service";
|
||||
};
|
||||
Install = { WantedBy = [ "timers.target" ]; };
|
||||
|
|
|
@ -3,6 +3,7 @@ WantedBy=timers.target
|
|||
|
||||
[Timer]
|
||||
OnCalendar=monthly
|
||||
Persistent=true
|
||||
Unit=nix-gc.service
|
||||
|
||||
[Unit]
|
||||
|
|
Loading…
Reference in a new issue