Nixos old generations useup all sapce on boot partition

You can use nix-collect-garbage to delete old generations, after which nixos-rebuild should clean up the old boot entries. If /boot is already out of space then nixos-rebuild might fail - see How can I clean up /boot, without a reboot