Problem Link to heading

My system ran out of space, and I am unable to run sudo nix-collect-garbage -d.

❯ sudo nix-collect-garbage -d
removing old generations of profile /nix/var/nix/profiles/per-user/root/channels
error: opening lock file '/nix/var/nix/profiles/per-user/root/channels.lock': No space left on device

Solution Link to heading

Remove your ~/.cache/nix and you should be able to collect the garbage and untangle your system.