Skip to content

Instantly share code, notes, and snippets.

@krupkat
Last active August 7, 2023 07:43
Show Gist options
  • Save krupkat/1b75c5304aff14d5047fd4dbb8870b8d to your computer and use it in GitHub Desktop.
Save krupkat/1b75c5304aff14d5047fd4dbb8870b8d to your computer and use it in GitHub Desktop.
[NixOS x Windows dualboot] #nixos #windows

Custom size boot partition for Windows

During Windows installation, follow https://www.ctrl.blog/entry/how-to-esp-windows-setup.html:

  1. Select "Custom installation"
  2. Delete all partitions if there are any
  3. Shift + F10 for cmd.exe
  4. diskpart.exe
  5. list disk
  6. select disk n
  7. create partition efi size=1024
  8. format quick fs=fat32 label=System
  9. exit
  10. exit

Continue with the install, leave space in the disk for a NixOS partition

Disable fast boot

Control Panel -> Power options -> Power buttons -> Turn off fast startup

  • disable secure boot in BIOS

Install NixOS from USB

Working dual boot setup is installed with the graphical installer.

If needed to regenerate EFI entry

If Windows / BIOS update utility somehow deletes the nixos EFI entry, try https://nixos.wiki/wiki/Bootloader#From_an_installation_media

  1. From a LiveUSB, mount the root partition somewhere, e.g. /path
  2. Mount the boot partition in /path/boot
  3. sudo nixos-enter --root /path
  4. NIXOS_INSTALL_BOOTLOADER=1 /nix/var/nix/profiles/system/bin/switch-to-configuration boot

NIXOS_INSTALL_BOOTLOADER=1 /nix/var/nix/profiles/system/bin/switch-to-configuration boot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment