Convert BIOS NixOS to UEFI NixOS

I have NixOS installed BIOS-mode on a USB m.2

Now I have a laptop I need to insert it into, which is UEFI Class 3, which doesn’t have CSM, so I would need to convert the drive.

Do we have some kind of procedure for that?:wink:

You’d have to:

  • convert the MBR layout into a GPT layout
  • create a new ESP partition
  • change NixOS configuration for UEFI
  • activate the bootloader installation, populating the ESP and the EFIVARS with the new bootloader

And then it should be good.

Not to be That Person, and I have done this successfully, even making Windows happy, but I’d recommend a backup of anything terribly important :wink: .

GPT and ESP are straight forward, but changing NixOS to UEFI is a bit vague;) Also, If I change it to UEFI, it might not boot.

I also wonder why it was installed in BIOS mode, if UEFI was possible. Can this somehow be selected when installing?

Do you still have access to your non-UEFI machine? systemd-boot will install itself into the default UEFI location, so you should theoretically be able to change your NixOS configuration on that machine, switch into it, and then have it boot on your UEFI machine.

But, you’d still need to configure it correctly, switch to GPT, make sure you have a ef00 efi partition, etc.