configuration.nix/modules/nix.nix
2024-07-05 02:03:52 +05:30

18 lines
435 B
Nix

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