Skip to content

Commit

Permalink
cleanup x script
Browse files Browse the repository at this point in the history
  • Loading branch information
appaquet committed Jan 24, 2025
1 parent 8441d23 commit 2856fc2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions x
Original file line number Diff line number Diff line change
Expand Up @@ -315,17 +315,13 @@ gc)
shift
echo "Garbage collecting..."

nix-collect-garbage --delete-older-than "14d"
home-manager expire-generations "-14 days"
nix-collect-garbage --delete-older-than "7d"
home-manager expire-generations "-7 days"

# Cleaning as root collects more stuff as well
# See https://www.reddit.com/r/NixOS/comments/10107km/how_to_delete_old_generations_on_nixos/?s=8
ncg=$(which nix-collect-garbage)
sudo ${ncg} -d --delete-older-than "14d"

if [[ "$NIXOS" -eq 1 ]]; then
echo "⏩️ Call x nixos boot to remove old generations from boot"
fi
sudo ${ncg} -d --delete-older-than "7d"
;;

fmt)
Expand Down

0 comments on commit 2856fc2

Please sign in to comment.