My system complains with 0 bytes available in /boot.
Looks like I have 40 items filling 97% of /boot in /boot/kernels.
Last thing I tried was adding:
boot.loader.grub.configurationLimit=4
``` to my nixos/configuration.nix file... but it did not seems to have changed anything.
Still having generations 8..36 in advanced grub.
Before I tried: # nix-collect-garbage -d
Thinking of "randomly" erasing init and kernel files.
[root@nixos:/home/paul/Downloads]# ./trim-generations.sh
Keeping default: 10 generations OR 7 days, whichever is more
Operating on profile: /nix/var/nix/profiles/default
./trim-generations.sh: line 94: nixGens[0]: unbound variable
[root@nixos:/home/paul/Downloads]#
[root@nixos:/home/paul/Downloads]# sudo nixos-rebuild boot
building Nix...
building the system configuration...
updating GRUB 2 menu...
cannot copy /nix/store/0vg550136ac5jzcaagq7cjjdvrgcmv2r-initrd-linux-6.1.42/initrd to /boot/kernels/0vg550136ac5jzcaagq7cjjdvrgcmv2r-initrd-linux-6.1.42-initrd.tmp: No space left on device
warning: error(s) occurred while switching to the new configuration
So maybe I need to erased at least one or 2 entries manually.
Did you rebuild your system afterwards? That option’s script runs on system activation. If you can’t rebuild due to disk space issues, you can indeed remove old kernels manually, it should no longer be necessary in the future.
nix-collect-garbage does not touch the boot partition, it only cleans up /nix/store.