Boot
This guide covers how to change what you boot into from both Windows and NixOS.
🔄 Methods to Change Boot Order
Section titled “🔄 Methods to Change Boot Order”1. From NixOS (Recommended)
Section titled “1. From NixOS (Recommended)”Using Keyboard Shortcuts
Section titled “Using Keyboard Shortcuts”- Super+Ctrl+B: Show current boot information
- Super+Shift+B: List all boot entries
- Super+Alt+B: Show available boot commands
Using Terminal Commands
Section titled “Using Terminal Commands”## Set next boot to NixOSset-boot-nixos
## Set next boot to Windowsset-boot-windows
## Show current boot configurationboot-info
## List all boot entrieslist-boot-entriesManual EFI Management
Section titled “Manual EFI Management”## List all boot entriessudo efibootmgr
## Set next boot (one-time)sudo efibootmgr --bootnext 0001 # Replace with boot number
## Change boot order permanentlysudo efibootmgr --bootorder 0001,0002,0003 # Replace with actual numbers2. From Windows
Section titled “2. From Windows”Method 1: EasyBCD (Recommended)
Section titled “Method 1: EasyBCD (Recommended)”- Download EasyBCD (free for personal use)
- Run as Administrator
- Go to “Edit Boot Menu”
- Reorder entries or set default
- Click “Save Settings”
Method 2: bcdedit (Built-in)
Section titled “Method 2: bcdedit (Built-in)”- Open Command Prompt as Administrator
- View current entries:
Terminal window bcdedit /enum - Set default boot:
Terminal window bcdedit /default {identifier} - Set timeout:
Terminal window bcdedit /timeout 10
Method 3: System Configuration
Section titled “Method 3: System Configuration”- Press
Win+R, typemsconfig - Go to “Boot” tab
- Select desired OS and click “Set as default”
- Adjust timeout if needed
- Click “OK”
Method 4: UEFI/BIOS Setup
Section titled “Method 4: UEFI/BIOS Setup”- Restart your computer
- Enter BIOS/UEFI (usually F2, F12, Del, or Esc)
- Navigate to “Boot” or “Boot Order”
- Reorder boot entries
- Save and exit
3. From GRUB Menu (At Boot Time)
Section titled “3. From GRUB Menu (At Boot Time)”One-Time Selection
Section titled “One-Time Selection”- Restart computer
- When GRUB menu appears, use arrow keys
- Select desired OS
- Press Enter to boot
Permanent Default
Section titled “Permanent Default”- Boot into NixOS
- Edit
/etc/default/grub:GRUB_DEFAULT=2 # Set to Windows entry numberGRUB_TIMEOUT=10 # Show menu for 10 seconds - Rebuild GRUB:
Terminal window sudo nixos-rebuild switch
🔧 Advanced Configuration
Section titled “🔧 Advanced Configuration”Custom GRUB Configuration
Section titled “Custom GRUB Configuration”To permanently change boot order in NixOS:
## In your hardware-configuration.nix or a separate boot moduleboot.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 } '';};Network Boot Management
Section titled “Network Boot Management”For remote boot management via SSH:
## From any machine with SSH accessssh luxus@lea-ip "sudo set-boot-windows && sudo reboot"
## Or create a script for remote boot management#!/bin/bashcase $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📱 Mobile Boot Control
Section titled “📱 Mobile Boot Control”Android App
Section titled “Android App”- Use Termux with SSH
- Create aliases for boot commands
- Execute remote boot commands
iOS Shortcut
Section titled “iOS Shortcut”- Create Siri Shortcut
- Add “Run SSH Script” action
- Add boot management commands
🎯 Quick Reference
Section titled “🎯 Quick Reference”From NixOS
Section titled “From NixOS”## Quick boot to Windowsset-boot-windows && sudo reboot
## Quick boot to NixOS (if Windows was default)set-boot-nixos && sudo rebootFrom Windows
Section titled “From Windows”## Quick boot to NixOS (requires admin)bcdedit /default {identifier-for-nixos}shutdown /r /t 0🔍 Troubleshooting
Section titled “🔍 Troubleshooting”GRUB Not Showing
Section titled “GRUB Not Showing”- Hold
Shiftwhile rebooting - Edit GRUB timeout:
boot.loader.grub.timeout = 10;
- Rebuild:
sudo nixos-rebuild switch
EFI Boot Issues
Section titled “EFI Boot Issues”## Check EFI variablessudo efibootmgr -v
## Reset boot order to defaultssudo efibootmgr --bootorder 0000,0001,0002,0003,0004
## Create missing boot entrysudo efibootmgr --create --disk /dev/sda --part 1 --label "NixOS" --loader "\\EFI\\NixOS\\grubx64.efi"Windows Boot Manager Issues
Section titled “Windows Boot Manager Issues”## Rebuild BCDbootrec /fixmbrbootrec /fixbootbootrec /rebuildbcd
## Reset to defaultsbcdedit /deletevalue {default} recoveryenabledbcdedit /set {default} recoveryenabled Yes🚀 Automation Scripts
Section titled “🚀 Automation Scripts”Boot Toggle Script
Section titled “Boot Toggle Script”#!/bin/bash## Toggle between NixOS and Windowsif efibootmgr | grep -q "BootNext.*NixOS"; then set-boot-windows echo "Next boot: Windows"else set-boot-nixos echo "Next boot: NixOS"fiScheduled Boot
Section titled “Scheduled Boot”## Schedule boot to Windows at 6 PM dailyecho "0 18 * * * luxus /usr/bin/set-boot-windows" | sudo tee -a /etc/crontab📋 Boot Entry Numbers
Section titled “📋 Boot Entry Numbers”Typical boot entry pattern:
0000: NixOS0001: Windows Boot Manager0002: UEFI Settings0003: Network Boot
Check your actual numbers with efibootmgr or boot-info.