NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.99k stars 14.01k forks source link

Grub on nix-17.09 and nix-unstable doesn't respect efiSupport #33593

Closed noobpurple closed 6 years ago

noobpurple commented 6 years ago

Issue description

When trying to rebuild NixOS with Grub2 and EFI support enabled on my desktop, it tries to install with the i386-pc target, which obviously fails. I tried this with both nix-17.09 and nix-unstable, same result. I already installed it with systemd-boot as the manual says, but I'd prefer grub because of themeing and os-prober.

Steps to reproduce

In my configuration.nix,

boot.loader.efi.canTouchEfiVariables = true; boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/sdc"; boot.loader.grub.efiSupport = true;

Running nixos-rebuild switch goes through everything fine until grub tries to install. It says "Installing for i386-pc platform" before spitting out an error becaues I don't have a BIOS boot partition.

Technical details

bjornfor commented 6 years ago

Perhaps boot.loader.grub.efiSupport should be interpreted as "efi-support-in-addition-to-bios"?

jokogr commented 6 years ago

Use boot.loader.grub.device = "nodev"; and check the relevant option at https://nixos.org/nixos/options.html#boot.loader.grub.device

/dev/sdc implies a BIOS installation, not an EFI one.

noobpurple commented 6 years ago

Well, specifying "nodev" allowed it to install properly with the x86_64-efi target. I'm not sure why that worked, though. The option description says that "nodev" just means that the menu is generated but Grub isn't actually installed. Am I missing some documentation somewhere about UEFI and Grub? Anyway, that solved my issue, so thanks!