NixOS manual install not installing a bootloader

I have been trying to install NixOS on my desktop for a few days now, following a video guide for a manual install, but that failed to leave me with a bootable system. I figured I made a mistake, no big deal.

I tried to use the graphical installer on the most recent Gnome image, and went through the steps for that twice before reading that there seems to be a known issue with those images not properly installing a boot loader (?) and to try a manual install. No problem, I’ll give it another shot.

So now today I have been attempting a manual install following the NixOS manual for a manual install, reading through it carefully, reading posts both here and on the NixOS subreddit if I ran into issues or had ANY questions because I always fell bad making new posts about issues. I went through the install, I edited the configuration.nix file, I added my user there and gave it a password after the install finished and I rectified all of the errors. The installation completed, the guide said at that point I should be good. So I reboot my system.

Straight to BIOS, which shows no bootable drives on my system. I don’t know what else to do, or where else to look for fixes. I am using NixOS on my laptop and I love it, and that install (done nearly 9 months ago) went perfectly and I haven’t had any issues there at all. For whatever reason though I cannot figure out what I’m missing on my desktop.

You give us very little information to work on. Try to answer some the following questions:

  • Did you install NixOS alongside other S.O.? If yes, which one?
  • Did you get any error from the installer? Maybe it has logged something,maybe open a terminal and look into the logs in /var/log or with journalctl
  • When you that it “failed to leave me with a bootable system” what you mean, what happens when you go through the boot process?
  • Which kind of boot process is enabled in the BIOS? UEFI, legacy or both? Do you have “UEFI” enabled in a BIOS tab named “Security”? If that’s the case, please disable it.
  • Which partition scheme do you have on the storage disk? DOS or GPT?

Hello. This seems very weird. Most likely you have a boot loader installed but the boot entry is just missing. You can try to enter your nixos system with the following with a live iso:

 1. Boot from installation media Nixos
 2. mount /dev/[root partition] /mnt
 3. mount /dev/[boot partition] /mnt/boot
 4. sudo nixos-enter
 5. Look inside /boot to see if a boot loader is installed. (you may need to be root for that. therefore just type su in the terminal)
 6. NIXOS_INSTALL_BOOTLOADER=1 /nix/var/nix/profiles/system/bin/switch-to-configuration boot #to reinstal the boot loader
 7. reboot into Bios 

Also make sure that you do this.

Definitely make sure that you use UEFI.

I apologize, I don’t know what I don’t know, I wasn’t sure what is relevant initially and with no way to show what the files say in an image or copying the text I couldn’t know what else to add.

  • I originally was attempting to dual boot with my Windows 10 install, but one of my attempts accidentally wrote over my install so currently, no, I am not installing along side any OS
  • I attempted to fix all the errors myself as they came up, reading through posts here and on the subreddit, by the time I was ready to reboot the machine, there were no errors the installer was throwing my way
  • I could reboot into the live environment on system and look at the logs if that’s necessary, but I don’t know what or how to handle that from the minimal installer image
  • My BIOS are UEFI, I don’t see anything like that under my “Security” header but honestly, I don’t feel tech literate so it is possible I am missing something there.
  • The partition scheme, I believe, is GPT. I was following the guide here step by step and it starts with the command
    parted /dev/sda -- mklabel gpt

If there is any other information necessary I will be happy to do my best to find it, and I apologize again for the lack of initial information

In /boot after following the steps you laid out, running ls shows a grub directory. I don’t understand exactly what you mean in step 6, but it doesn’t appear to matter as I cannot sudo or su to edit the file you specified

Usually this means the installer iso was booted in the legacy/mbr mode. See NixOS Manual for how to partition your disk for legacy/mbr mode.

Alternatively, disable the csm/legacy boot compatibility in your bios and try again. Make sure to check that the installer iso is actually booted in the uefi mode: Quickly Check If Linux System is Using BIOS or UEFI - kifarunix.com

How could this happen? I don’t understand the difference.

my system has now decided that it doesn’t want to boot into BIOS or into my ventoy drive to get to the image, and at this point I don’t know what I’m supposed to do but it’s beginnig to feel like every trouble shooting step I follow makes my hardware refuse to function in some new, unexpected way

Sorry. I meant that you just run NIXOS_INSTALL_BOOTLOADER=1 /nix/var/nix/profiles/system/bin/switch-to-configuration boot. This will reinstall the boot loader.

Do you mean that you can’t get into your BIOS of you computer?

I see, I initially navigated to that file, and then was looking for a line to edit or a variable to change but I decided it was better to ask than add a new line I didn’t understand. I’m glad I did.

Yes, I turned the machine off for now, but my machine wasn’t giving me any video output at all. I will give that command a shot in a little while

Sorry for the late reply, I was doing some more searching and a few sources say to run the same command you recommend.

I mounted the root partition and the boot partition to the mount points they should be, ran a sudo nixos-enter and ran NIXOS_INSTALL_BOOTLOADER=1 /nix/var/nix/profiles/system/bin/switch-to-configuration boot and I get this error message

ERROR: mkdir /var/lock/dmraid

But it also say “Installation finished. No error reported.”

I rebooted again out of curiosity and still nothing, so I booted back into the livecd, ran the commands again, and am now looking at an identical output

Edit: I tried to put Arch onto my desktop on a different drive, to see if I could get a system that worked to use for now. That also failed to show up as bootable in my BIOS so either I’m majorly messing something up or my desktop has some allergy to bootloaders

Than it is most likely not related to nixos but rather your bios. What are your boot settings, Uefi, Legacy…?
Set this setting to UEFI and try a re installation (maybe try the GUI installer to rule out a mistake in the installation process). Also important disable secure boot and fast boot.
Further more what is the mainboard you are using?