configuration.nix/modules/nix.nix

20 lines
469 B
Nix

{ lib, config, ... }:
let cfg = config.nodeconfig; in {
options.nodeconfig = {
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";
};
};
}