Skip to content

Instantly share code, notes, and snippets.

@offlinehacker
Created July 3, 2014 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save offlinehacker/737007bd9bbfebfba931 to your computer and use it in GitHub Desktop.
Save offlinehacker/737007bd9bbfebfba931 to your computer and use it in GitHub Desktop.
path=$(nix-collect-garbage -d 2>&1 | grep error: | awk -F"\`" '{print $2}' | awk -F"\'" '{print $1}')
echo $path
until [ $path = */nix/store* ]; do
sqlite3 /nix/var/nix/db/db.sqlite "DELETE FROM ValidPaths WHERE path='$path'"
nix-store --delete $path
path=$(nix-collect-garbage -d 2>&1 | grep error: | awk -F"\`" '{print $2}' | awk -F"\'" '{print $1}')
echo $path
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment