From 28e9c221add566705fc38ac45f33bc87427f107f Mon Sep 17 00:00:00 2001 From: Drew Haven Date: Fri, 25 Apr 2025 15:24:33 -0700 Subject: [PATCH] [nix] Adds GC --- system/features/gc.nix | 8 ++++++++ system/hosts/altair/default.nix | 1 + system/hosts/mcp/default.nix | 1 + system/hosts/vega/configuration.nix | 10 +--------- system/hosts/vega/default.nix | 1 + 5 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 system/features/gc.nix diff --git a/system/features/gc.nix b/system/features/gc.nix new file mode 100644 index 0000000..33627e4 --- /dev/null +++ b/system/features/gc.nix @@ -0,0 +1,8 @@ +{ ... }: { + # Automatic + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; +} diff --git a/system/hosts/altair/default.nix b/system/hosts/altair/default.nix index c908a19..40a7ce8 100644 --- a/system/hosts/altair/default.nix +++ b/system/hosts/altair/default.nix @@ -4,6 +4,7 @@ ./configuration.nix ./hardware-configuration.nix ../../authorized-keys.nix + ../../features/gc.nix ../../features/gui.nix ]; diff --git a/system/hosts/mcp/default.nix b/system/hosts/mcp/default.nix index af5aff3..a8bde06 100644 --- a/system/hosts/mcp/default.nix +++ b/system/hosts/mcp/default.nix @@ -5,6 +5,7 @@ ./hardware-configuration.nix ../../authorized-keys.nix inputs.sops-nix.nixosModules.sops + ../../features/gc.nix ]; nixpkgs.config.allowUnfree = true; diff --git a/system/hosts/vega/configuration.nix b/system/hosts/vega/configuration.nix index 46cb51c..c4b27eb 100644 --- a/system/hosts/vega/configuration.nix +++ b/system/hosts/vega/configuration.nix @@ -1,12 +1,4 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - -{ - pkgs, - ... -}: - +{ pkgs, ... }: { networking.hostName = "vega"; # Define your hostname. diff --git a/system/hosts/vega/default.nix b/system/hosts/vega/default.nix index c908a19..40a7ce8 100644 --- a/system/hosts/vega/default.nix +++ b/system/hosts/vega/default.nix @@ -4,6 +4,7 @@ ./configuration.nix ./hardware-configuration.nix ../../authorized-keys.nix + ../../features/gc.nix ../../features/gui.nix ];