From 7d1e5d46de8930fae1ac9dfc0230e171df46058a Mon Sep 17 00:00:00 2001
From: Mark Nipper <nipsy@bitgnome.net>
Date: Sat, 30 Mar 2024 21:34:08 -0700
Subject: Add some store management commands

---
 ginaz/README | 9 +++++++++
 1 file changed, 9 insertions(+)

(limited to 'ginaz')

diff --git a/ginaz/README b/ginaz/README
index 373522d..496d7f2 100644
--- a/ginaz/README
+++ b/ginaz/README
@@ -58,3 +58,12 @@ nixos-rebuild switch --upgrade
 
 # later upgrades after flakes are enabled
 cd /etc/nixos && nix flake update && cd && nixos-rebuild switch --upgrade && echo && nixos-rebuild list-generations | cat && echo && nix store diff-closures $(find /nix/var/nix/profiles -iname system-\* -type l | sort | tail -2 | xargs)
+
+# clean up all but the two most recent systems
+nixos-rebuild list-generations | cat
+rm $(ls /nix/var/nix/profiles/system-*-link -1dtr | head -n -2)
+nixos-rebuild list-generations | cat
+nix-store --gc
+
+# deduplicate the store
+nix store optimise
-- 
cgit v1.2.3