From a771537a65b8c34bd87ac67dc6c6a86a381efaf0 Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Wed, 12 Jun 2024 21:42:01 +0200 Subject: [PATCH] nix-common: Add option for gc interval --- machines/heimdall/configuration.nix | 6 ++---- modules/nix-common/default.nix | 7 ++++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/machines/heimdall/configuration.nix b/machines/heimdall/configuration.nix index 40ba454..f4dfba6 100644 --- a/machines/heimdall/configuration.nix +++ b/machines/heimdall/configuration.nix @@ -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"; }; }; diff --git a/modules/nix-common/default.nix b/modules/nix-common/default.nix index 1de0a0d..d06b118 100644 --- a/modules/nix-common/default.nix +++ b/modules/nix-common/default.nix @@ -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"; }; };