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