From a07b0a38ac373c58846006b7ac3178f01b096644 Mon Sep 17 00:00:00 2001 From: Purin <118902463+Dylouwu@users.noreply.github.com> Date: Mon, 25 Aug 2025 15:24:00 +0200 Subject: [PATCH] garbage collect cleans more stuff You might want to remove the logging Signed-off-by: Purin <118902463+Dylouwu@users.noreply.github.com> --- home/scripts/nixy/default.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/home/scripts/nixy/default.nix b/home/scripts/nixy/default.nix index b51aec8..51f1c13 100644 --- a/home/scripts/nixy/default.nix +++ b/home/scripts/nixy/default.nix @@ -55,8 +55,17 @@ let elif [[ $1 == "update" ]];then cd ${configDirectory} && nix flake update elif [[ $1 == "gc" ]];then - cd ${configDirectory} && sudo nix-collect-garbage -d - cd ${configDirectory} && nix-collect-garbage -d + echo "Starting Nix garbage collection..." + cd ${configDirectory} && \ + echo "Cleaning up system garbage..." && \ + sudo nix-collect-garbage -d && \ + echo "Cleaning up user garbage..." && \ + nix-collect-garbage -d && \ + echo "Collecting garbage from Nix store..." && \ + nix-store --gc && \ + echo "Optimizing Nix store..." && \ + nix-store --optimise + echo "Nix garbage collection complete." elif [[ $1 == "cb" ]];then sudo /run/current-system/bin/switch-to-configuration boot elif [[ $1 == "listgen" ]];then