nix
Nix
Garbage Collecting Error - Disk Full
cd /nix/var/nix/db
nix-shell -p sqlite
---
nix-env --delete-generations old
nix-collect-garbage
sudo nix-collect-garbage
We're down to 19.1 GiB
Let's do a full rebuild and make sure we're as compact as possible. Note that this removes old generations, make sure your system is stable first.
nix-channel --update
sudo nix-channel --update
sudo rm /nix/var/nix/gcroots/auto/*
nix-collect-garbage -d
sudo nix-collect-garbage -d
Down to 9.4 GiB
By hardlinking identical files we can save some additional space:
sudo nix-store --optimize
Now we're down to a nice trim 9.0 GiB - a savings of 15.1 GiB at the cost of losing some history.
Note that any shells you have will have to be rebuilt or refetched.
Pruning docker
I use docker for application development, this was done before but can save considerable space:
docker system prune
Note that this will delete a whole bunch of stuff, if you have any data not stored in volumes it will be lost.
Clearing your .cache folder
My .cache folder stands at 9.9 GiB
The highest amount is currently spotify. By editing ~/.config/spotify/prefs and adding:
storage.size=2048
then restarting spotify it will trim down its storage.
Next up is yarn.
yarn cache clean
saves me another 2.1 GiB
~/.local/share/Trash has considerable data in it, which after quick verification doesn't have anything I care about.
rm -rf ~/.local/share/Trash/files/*
rm -rf ~/.local/share/Trash/files/.*
After this I spent a bit poking around in ncdu and deleting old projects and forks that were not longer used.
---
## Get sha256 of URL or URL tarball
```bash
nix-prefetch-url https://github.com/NixOS/nixpkgs/archive/fksjflskjfsdlfkjslksjfsdlfkjdsjGet size of derivation or nixpkgs
nixpkgsFix nix store issues
nix store issuesNix Package Manager
Multiuser Installation
Home Manager
Installation Non-NixOS
Standalone installation
Last updated