diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/gc | 27 |
1 files changed, 24 insertions, 3 deletions
@@ -79,12 +79,32 @@ disk() { gc_guix() { - pass show velhinho/andreh | head -n1 | sudo -iS guix system delete-generations - pass show velhinho/andreh | head -n1 | sudo -iS guix gc --optimize -d + if [ -e /var/guix/profiles/system ]; then + pass show "$(hostname)"/andreh | head -n1 | + sudo -iS sh -c 'guix system delete-generations && guix gc -d' + fi guix home delete-generations - guix gc --optimize -d + guix gc -d } +gc_nix() { + if [ ! -e /nix/ ]; then + return + fi + + PROFILES=' + /nix/var/nix/profiles/per-user/root/channels + /nix/var/nix/profiles/system + ' + + for p in $PROFILES; do + pass show "$(hostname)"/andreh | head -n1 | + sudo -iS nix-env --delete-generations old -p "$p" + done + nix-env --delete-generations old + nix-store --gc + nix-collect-garbage -d +} gc_nohup() { find ~/ -type f -name 'nohup.out' -exec rm -vf "{}" \; } @@ -123,6 +143,7 @@ gc_vcs() { gc_all() { set -x gc_guix + gc_nix gc_nohup gc_trash gc_tmpdir |