Skip to content

Boot

This guide covers how to change what you boot into from both Windows and NixOS.

  • Super+Ctrl+B: Show current boot information
  • Super+Shift+B: List all boot entries
  • Super+Alt+B: Show available boot commands
Terminal window
## Set next boot to NixOS
set-boot-nixos
## Set next boot to Windows
set-boot-windows
## Show current boot configuration
boot-info
## List all boot entries
list-boot-entries
Terminal window
## List all boot entries
sudo efibootmgr
## Set next boot (one-time)
sudo efibootmgr --bootnext 0001 # Replace with boot number
## Change boot order permanently
sudo efibootmgr --bootorder 0001,0002,0003 # Replace with actual numbers
  1. Download EasyBCD (free for personal use)
  2. Run as Administrator
  3. Go to “Edit Boot Menu”
  4. Reorder entries or set default
  5. Click “Save Settings”
  1. Open Command Prompt as Administrator
  2. View current entries:
    Terminal window
    bcdedit /enum
  3. Set default boot:
    Terminal window
    bcdedit /default {identifier}
  4. Set timeout:
    Terminal window
    bcdedit /timeout 10
  1. Press Win+R, type msconfig
  2. Go to “Boot” tab
  3. Select desired OS and click “Set as default”
  4. Adjust timeout if needed
  5. Click “OK”
  1. Restart your computer
  2. Enter BIOS/UEFI (usually F2, F12, Del, or Esc)
  3. Navigate to “Boot” or “Boot Order”
  4. Reorder boot entries
  5. Save and exit
  1. Restart computer
  2. When GRUB menu appears, use arrow keys
  3. Select desired OS
  4. Press Enter to boot
  1. Boot into NixOS
  2. Edit /etc/default/grub:
    GRUB_DEFAULT=2 # Set to Windows entry number
    GRUB_TIMEOUT=10 # Show menu for 10 seconds
  3. Rebuild GRUB:
    Terminal window
    sudo nixos-rebuild switch

To permanently change boot order in NixOS:

## In your hardware-configuration.nix or a separate boot module
boot.loader.grub = {
enable = true;
efiSupport = true;
useOSProber = true;
default = 2; # Set Windows as default (0-based index)
timeout = 10; # Show menu for 10 seconds
extraEntries = ''
menuentry "Windows 11" {
insmod part_gpt
insmod fat
insmod chain
search --file --set=root /EFI/Microsoft/Boot/bootmgfw.efi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
'';
};

For remote boot management via SSH:

Terminal window
## From any machine with SSH access
ssh luxus@lea-ip "sudo set-boot-windows && sudo reboot"
## Or create a script for remote boot management
#!/bin/bash
case $1 in
nixos) ssh luxus@lea-ip "sudo set-boot-nixos && sudo reboot" ;;
windows) ssh luxus@lea-ip "sudo set-boot-windows && sudo reboot" ;;
*) echo "Usage: $0 [nixos|windows]" ;;
esac
  1. Use Termux with SSH
  2. Create aliases for boot commands
  3. Execute remote boot commands
  1. Create Siri Shortcut
  2. Add “Run SSH Script” action
  3. Add boot management commands
Terminal window
## Quick boot to Windows
set-boot-windows && sudo reboot
## Quick boot to NixOS (if Windows was default)
set-boot-nixos && sudo reboot
Terminal window
## Quick boot to NixOS (requires admin)
bcdedit /default {identifier-for-nixos}
shutdown /r /t 0
  1. Hold Shift while rebooting
  2. Edit GRUB timeout:
    boot.loader.grub.timeout = 10;
  3. Rebuild: sudo nixos-rebuild switch
Terminal window
## Check EFI variables
sudo efibootmgr -v
## Reset boot order to defaults
sudo efibootmgr --bootorder 0000,0001,0002,0003,0004
## Create missing boot entry
sudo efibootmgr --create --disk /dev/sda --part 1 --label "NixOS" --loader "\\EFI\\NixOS\\grubx64.efi"
Terminal window
## Rebuild BCD
bootrec /fixmbr
bootrec /fixboot
bootrec /rebuildbcd
## Reset to defaults
bcdedit /deletevalue {default} recoveryenabled
bcdedit /set {default} recoveryenabled Yes
#!/bin/bash
## Toggle between NixOS and Windows
if efibootmgr | grep -q "BootNext.*NixOS"; then
set-boot-windows
echo "Next boot: Windows"
else
set-boot-nixos
echo "Next boot: NixOS"
fi
Terminal window
## Schedule boot to Windows at 6 PM daily
echo "0 18 * * * luxus /usr/bin/set-boot-windows" | sudo tee -a /etc/crontab

Typical boot entry pattern:

  • 0000: NixOS
  • 0001: Windows Boot Manager
  • 0002: UEFI Settings
  • 0003: Network Boot

Check your actual numbers with efibootmgr or boot-info.