From 7b5a43954c8f586abe369a5c4e02749ed97b8ed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Madeleine=20Sydney=20=C5=9Alaga?= Date: Sat, 31 Jan 2026 16:23:04 -0700 Subject: [PATCH] feat(gc): init --- hosts/deertopia/configuration.nix | 1 + modules/nixos/gc.nix | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 modules/nixos/gc.nix diff --git a/hosts/deertopia/configuration.nix b/hosts/deertopia/configuration.nix index cfbb5fc..f748d04 100644 --- a/hosts/deertopia/configuration.nix +++ b/hosts/deertopia/configuration.nix @@ -10,6 +10,7 @@ filesystemType = "btrfs"; stylix.enable = true; + gc.enable = true; openssh.enable = true; sydpkgs.overlay.enable = true; diff --git a/modules/nixos/gc.nix b/modules/nixos/gc.nix new file mode 100644 index 0000000..c7a66e8 --- /dev/null +++ b/modules/nixos/gc.nix @@ -0,0 +1,16 @@ +{ config, lib, pkgs, ... }: + +let cfg = config.sydnix.gc; +in { + options.sydnix.gc = { + enable = lib.mkEnableOption "the automatic Nix garbage collector"; + }; + + config = lib.mkIf cfg.enable { + nix.gc = { + automatic = true; + randomizedDelaySec = "14m"; + options = "--delete-older-than 30d"; + }; + }; +}