diff --git a/.config/bash/module/Nix.sh b/.config/bash/module/Nix.sh index f089b68..699c11e 100644 --- a/.config/bash/module/Nix.sh +++ b/.config/bash/module/Nix.sh @@ -37,3 +37,9 @@ function nix_update() { function nix_upgrade() { nixos-rebuild switch --upgrade } + +# Free up root space. +function nix_clean() { + nix-collect-garbage -d + [[ "${UID}" = 0 ]] && nix-store --gc +}