Cleaning up disk space used by Nix - Nix

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Joel McCracken

I'm looking at what all is using space on my machine rn, and noticing that nix is taking 22 gb; i suspect that there is some stuff in there that could be cleaned up

Joel McCracken

any advice on how to go about handling this?

Joel McCracken

i'm running nix optimise-store rn

Mats Rauhala

Have you done nix-collect-carbage? (with appropriate options)

Sridhar Ratnakumar

sudo nix-collect-garbage --delete-older-than 7d

Sridhar Ratnakumar

1TB is the recommended disk space on a developer laptop running NixOS for this reason. :-)

Mats Rauhala

Oh, and also nix-du might be useful

Joel McCracken

thank you, these helped.