Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@smatting smatting commented Jan 12, 2018

windowsUuid should be the UUID of the Windows EFI partition

@smatting

This comment has been minimized.

Copy link

@smatting smatting commented Jan 12, 2018

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