Skip to content

Instantly share code, notes, and snippets.

@jokogr
Created January 12, 2018 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jokogr/9b80966ed6860b833c5a6e546d45a470 to your computer and use it in GitHub Desktop.
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
{ 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;
}
@smatting
Copy link

windowsUuid should be the UUID of the Windows EFI partition

@smatting
Copy link

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