Unable to boot into VPS

Hi. I am trying to setup NixOS on a VPS. here is my steps:

  1. install minimal-cd on VPS and boot.
  2. run disko (I tried simple-efi and hybrid)
  3. run nixos-generate-config --no-filesystems --root /mnt and copy the result to my flake repo, push repo to github
  4. run nixos-install --root /mnt --flake github:<usr>/<repo>

it all goes fine and I even able to nixos-enter to the just installed system. but if I try to reboot I get stuck on Booting from Hard Disk.

so I guess something is wrong with GRUB but I dont know how to troubleshoot it, please help

Your VPS probably doesn’t emulate UEFI xor BIOS (likely it can’t do UEFI), and you have to account for that in your partition table and boot options.

it indeed did not support UEFI but the bigger problem was that I forgot to add those lines:

   #boot.loader.systemd-boot.enable = true;
   #boot.loader.efi.canTouchEfiVariables = true;
   boot.loader.grub.enable = true;
   boot.loader.grub.efiSupport = true;
   boot.loader.grub.efiInstallAsRemovable = true;