nix-common: Add option for gc interval

This commit is contained in:
Erwin Boskma 2024-06-12 21:42:01 +02:00
parent 8ab3ae5a5c
commit a771537a65
Signed by: erwin
SSH key fingerprint: SHA256:/Wk1WZdLg+vQHs3in9qq7PsIp8SMzwGSk/RLZ5zPuZk
2 changed files with 8 additions and 5 deletions

View file

@ -1,8 +1,5 @@
{ self, ... }@inputs: { self, ... }:
{ modulesPath, lib, ... }: { modulesPath, lib, ... }:
# let
# pkgs = self.inputs.nixpkgs.legacyPackages.x86_64-linux;
# in
{ {
imports = [ imports = [
"${modulesPath}/profiles/qemu-guest.nix" "${modulesPath}/profiles/qemu-guest.nix"
@ -26,6 +23,7 @@
keycloak.enable = true; keycloak.enable = true;
nix-common = { nix-common = {
enable = true; enable = true;
gc-interval = "03:15";
}; };
}; };

View file

@ -17,6 +17,11 @@ in
type = with types; listOf str; type = with types; listOf str;
default = [ ]; default = [ ];
}; };
gc-interval = mkOption {
description = "How often to run nix-collect-garbage";
type = types.str;
default = "weekly";
};
}; };
imports = [ imports = [
@ -82,7 +87,7 @@ in
gc = { gc = {
automatic = true; automatic = true;
dates = "weekly"; dates = cfg.gc-interval;
options = "--delete-older-than 30d"; options = "--delete-older-than 30d";
}; };
}; };