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

View file

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