2024-07-05 02:03:52 +05:30
|
|
|
{ lib, config, ... }:
|
|
|
|
let cfg = config.nodeconfig; in {
|
2024-07-05 02:13:53 +05:30
|
|
|
options.nodeconfig = {
|
|
|
|
nix.auto-gc = lib.mkOption {
|
|
|
|
type = lib.types.bool;
|
|
|
|
default = false;
|
|
|
|
example = true;
|
|
|
|
description = "Enable Automatic Garbage collection of the Nix store";
|
|
|
|
};
|
2024-07-05 02:03:52 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.nix.auto-gc {
|
|
|
|
nix.gc = {
|
|
|
|
automatic = true;
|
|
|
|
dates = "Fri *-*-* 00:00:00";
|
|
|
|
options = "--delete-old";
|
|
|
|
randomizedDelaySec = "1h";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|