mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 14:01:34 +01:00
gc: Enable on servers with gcroot cleanup only
This commit is contained in:
parent
b41d8bee99
commit
c6b56d87ff
4 changed files with 30 additions and 3 deletions
|
|
@ -1,14 +1,26 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.custom.services.gc;
|
||||
in
|
||||
{
|
||||
options.custom.services.gc.enable = lib.mkEnableOption "";
|
||||
options.custom.services.gc = {
|
||||
enable = lib.mkEnableOption "";
|
||||
onlyCleanRoots = lib.mkEnableOption "";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.custom.services.gc.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.nh = {
|
||||
enable = true;
|
||||
clean = {
|
||||
enable = true;
|
||||
dates = "weekly";
|
||||
extraArgs = "--keep 10 --keep-since 7d";
|
||||
extraArgs =
|
||||
[
|
||||
"--keep 10"
|
||||
"--keep-since 7d"
|
||||
(lib.optionalString cfg.onlyCleanRoots "--no-gc")
|
||||
]
|
||||
|> lib.concatStringsSep " ";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue