Created
January 12, 2018 20:40
-
-
Save jokogr/9b80966ed6860b833c5a6e546d45a470 to your computer and use it in GitHub Desktop.
Import this nix file to get grub installed in NixOS with UEFI and a Windows entry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, ... }: | |
# Run "lsblk -o NAME,UUID" to find the Windows partition | |
let | |
windowsUuid = "9658-3521"; | |
in { | |
boot.loader.grub = { | |
enable = true; | |
version = 2; | |
efiSupport = true; | |
devices = [ "nodev" ]; | |
extraEntries = '' | |
menuentry "Windows 10" { | |
insmod part_gpt | |
insmod fat | |
insmod search_fs_uuid | |
insmod chain | |
search --fs-uuid --no-floppy --set=root ${windowsUuid} | |
chainloader /EFI/Microsoft/Boot/bootmgfw.efi | |
} | |
''; | |
}; | |
boot.loader.efi.canTouchEfiVariables = true; | |
} |
Also make sure you have mounted your EFI partition to /boot before applying
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
windowsUuid should be the UUID of the Windows EFI partition