Jump to content

Dual Booting NixOS and Windows: Difference between revisions

→‎Grub: Remove old info
(→‎systemd-boot: copy edit)
(→‎Grub: Remove old info)
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:
=== systemd-boot ===
=== systemd-boot ===


{{ic|systemd-boot}} will automatically detect an Windows installation ({{ic|/EFI/Microsoft/Boot/bootmgfw.efi}}) present on the EFI System Partition (ESP) and add it as a boot option.
When {{ic|systemd-boot}} is installed to the same EFI System Partition (ESP) that Windows uses, it will automatically detect the Windows installation ({{ic|/EFI/Microsoft/Boot/bootmgfw.efi}}) and present it as a boot option.
 
You can verify detected boot loaders by running the {{ic|bootctl}} command.
 
A system pre-installed with Windows might have a small ESP partition size that is not sufficient to store the kernel and initrd files for multiple NixOS generations. One solution is to create an additional [https://uapi-group.org/specifications/specs/boot_loader_specification/#the-partitions XBOOTLDR] partition and configure {{ic|systemd-boot}} to use it:
 
{{File|/etc/nixos/configuration.nix|nix|<nowiki>
{
  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/57D4-A2B2";
      fsType = "vfat";
    };
  fileSystems."/efi" =
    { device = "/dev/disk/by-uuid/3280-5418";
      fsType = "vfat";
    };
 
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;
 
  boot.loader.efi.efiSysMountPoint = "/efi";
  boot.loader.systemd-boot.xbootldrMountPoint = "/boot";
}
</nowiki>}}


=== os-prober ===
=== os-prober ===
Line 55: Line 78:


==== Grub ====
==== Grub ====
<nowiki>systemd-boot</nowiki> can not load EFI binaries from other partitions,
and a pre-existing EFI partition from a Windows install may be smaller than we would like our <nowiki>/boot</nowiki> partition to be. If we still want Windows and NixOS to use the same EFI partition, we can use GRUB instead.


Here we assume:
Here we assume:
142

edits