From bb4c0753f129f1f6a75e744386de6953c4a7370d Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Mon, 27 May 2024 22:21:07 +0200 Subject: [PATCH] Optimize updates and cleanups Ensure old entries are deleted to free up disk space and inodes. Ensure to optimize in the end, in order to free up disk space and inodes. --- home/packages/custom/update-nixos-system/default.nix | 2 ++ home/packages/custom/update-system/default.nix | 2 ++ 2 files changed, 4 insertions(+) diff --git a/home/packages/custom/update-nixos-system/default.nix b/home/packages/custom/update-nixos-system/default.nix index 2eb262e..a659388 100644 --- a/home/packages/custom/update-nixos-system/default.nix +++ b/home/packages/custom/update-nixos-system/default.nix @@ -11,6 +11,8 @@ writeShellApplication { nvd diff "/nix/var/nix/profiles/$oldVersion" "/nix/var/nix/profiles/system" sudo nix-env -p /nix/var/nix/profiles/system --delete-generations +3 + nix-collect-garbage --delete-older-than 60d nix store gc + nix store optimize ''; } diff --git a/home/packages/custom/update-system/default.nix b/home/packages/custom/update-system/default.nix index 29ef574..bf43bdd 100644 --- a/home/packages/custom/update-system/default.nix +++ b/home/packages/custom/update-system/default.nix @@ -13,6 +13,8 @@ writeShellApplication { home-manager expire-generations '-12 days' nix-env --delete-generations +3 + nix-collect-garbage --delete-older-than 60d nix store gc + nix store optimize ''; }