Migrated from import based to config based
This commit is contained in:
26
modules/system/services/garbage-collection.nix
Normal file
26
modules/system/services/garbage-collection.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.settings.services.garbage-collection;
|
||||
in {
|
||||
options = {
|
||||
settings.services.garbage-collection.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Enable garbage collection of nix store
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 1w";
|
||||
};
|
||||
|
||||
nix.settings.auto-optimise-store = true;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user