mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 19:51:34 +01:00
27 lines
546 B
Nix
27 lines
546 B
Nix
{ config, lib, ... }:
|
|
let
|
|
cfg = config.custom.services.gc;
|
|
in
|
|
{
|
|
options.custom.services.gc = {
|
|
enable = lib.mkEnableOption "";
|
|
onlyCleanRoots = lib.mkEnableOption "";
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
programs.nh = {
|
|
enable = true;
|
|
clean = {
|
|
enable = true;
|
|
dates = "weekly";
|
|
extraArgs =
|
|
[
|
|
"--keep 10"
|
|
"--keep-since 7d"
|
|
(lib.optionalString cfg.onlyCleanRoots "--no-gc")
|
|
]
|
|
|> lib.concatStringsSep " ";
|
|
};
|
|
};
|
|
};
|
|
}
|