(NixOS) (FIXED) Can't nixos-rebuild switch because /boot is full even after nix-collect-garbage -d

Thought on resizing /boot but not sure if that could mess up Windows or NixOS partition.

Delete the old kernels manually from /boot (I’d keep at least one old one). Then delete those previous generations (I’d keep 1-2). Then rebuild. Yeah it’s annoying.

I keep my /boot at least 500 MiB for this reason.

1 Like

How should I do that?

There’s 4 steps mentioned, which are you asking about?

All of them. (sorry)

How big is your /boot, what is your disk format, are you using Legacy or UEFI boot and what boot loader are you using? nix-collect-garbage does not remove systemd-boot entries · Issue #51834 · NixOS/nixpkgs · GitHub might be helpful.

My /boot is 268,4MB in size and partition uses vfat, my Nix partition uses ext4 (I also have a Windows partition with NTFS), I’m using UEFI and GPT, and my bootloader is the default systemd-boot.

I’m dumb, didn’t knew you need to run nix-collect-garbage with sudo for it to work.

For full clarity:

And yes your system vs user profiles are different, so using sudo vs not matters.