From eb557507d07ba7402ad474d2c982bc35ce649fdd Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Sun, 5 Jan 2025 14:27:55 +0000 Subject: [PATCH 1/2] misc: garbage-collect nixos profiles older than 30 days --- common/misc.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/common/misc.nix b/common/misc.nix index af95d1b..3061e72 100644 --- a/common/misc.nix +++ b/common/misc.nix @@ -5,6 +5,7 @@ automatic = true; dates = "weekly"; randomizedDelaySec = "45min"; + options = "--delete-older-than 30d"; }; nix.optimise.automatic = true; services.fstrim.enable = true; From 96d16a8830b7d08a0a2f6bf4133a84e0b2f334b4 Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Sun, 5 Jan 2025 14:28:15 +0000 Subject: [PATCH 2/2] tohru: disable automatic nix store maintenance --- hosts/tohru/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hosts/tohru/default.nix b/hosts/tohru/default.nix index cde1a8d..e4f9c8e 100644 --- a/hosts/tohru/default.nix +++ b/hosts/tohru/default.nix @@ -1,5 +1,8 @@ { config, lib, pkgs, inputs, ... }: +let + inherit (lib) mkForce; +in { imports = [ ./filesystems.nix @@ -23,6 +26,11 @@ console.keyMap = "uk"; services.xserver.xkb.layout = "gb"; + # tohru does not have the resources to run these under other load and is generally powered off when not in use. + # instead, just run `nix-collect-garbage -d` and `nix-store --optimise` every so often. + nix.gc.automatic = mkForce false; + nix.optimise.automatic = mkForce false; + fountain.users.qenya.enable = true; age.secrets.user-password-tohru-qenya.file = ../../secrets/user-password-tohru-qenya.age; users.users.qenya.hashedPasswordFile = config.age.secrets.user-password-tohru-qenya.path;