From 667c3358390796dd7e55e4311ec0f39ba15cecd1 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Sun, 1 Oct 2023 22:06:05 +0100 Subject: [PATCH] feat: added in some automatic garbage collection Also merged all teh nix options together. --- applications/ldap/client.nix | 5 ----- machines/_base.nix | 23 +++++++++++++++++++++-- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/applications/ldap/client.nix b/applications/ldap/client.nix index 32ce8da..d172b42 100644 --- a/applications/ldap/client.nix +++ b/applications/ldap/client.nix @@ -69,11 +69,6 @@ in { } ]; - nix.settings.trusted-users = [ - "root" - "@skynet-admins-linux" - ]; - # give users a home dir security.pam.services.sshd.makeHomeDir = true; diff --git a/machines/_base.nix b/machines/_base.nix index d3425a6..240bf59 100644 --- a/machines/_base.nix +++ b/machines/_base.nix @@ -25,8 +25,27 @@ ../applications/restic.nix ]; - # flakes are essensial - nix.settings.experimental-features = ["nix-command" "flakes"]; + nix = { + settings = { + # flakes are essensial + experimental-features = ["nix-command" "flakes"]; + trusted-users = [ + "root" + "@skynet-admins-linux" + ]; + }; + + # https://nixos.wiki/wiki/Storage_optimization + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + extraOptions = '' + min-free = ${toString (100 * 1024 * 1024)} + max-free = ${toString (1024 * 1024 * 1024)} + ''; + }; system.stateVersion = "22.11";