jamie-hyperv is a Generation 2 Hyper-V guest running KDE Plasma with dev tools.
The NixOS config uses the built-in virtualisation.hypervGuest module, which loads the hv_* kernel modules, installs the Hyper-V daemons, and adds udev rules for CPU/memory hotplug.
The hyperv-image module in nixpkgs produces a VHDX you can import directly into Hyper-V. No manual install needed.
From any machine with Nix installed:
nix build .#nixosConfigurations.jamie-hyperv.config.system.build.images.hypervThe result is a .vhdx file in ./result/. The default disk size is 4 GiB. The root partition auto-grows on first boot using boot.growPartition, so the image stays small even if you allocate a large virtual disk in Hyper-V.
To change the image size at build time, add this to the host config:
# size in MiB
virtualisation.diskSize = 40 * 1024;- Copy the
.vhdxfile to your Windows machine - Open Hyper-V Manager
- Create a new VM: Generation 2, disable Secure Boot
- Point the virtual hard disk at the
.vhdxfile you copied - Give it at least 2 GB of RAM and 2 vCPUs
- Start the VM
Once the VM is running, apply config changes from inside it:
sudo nixos-rebuild switch --flake .#jamie-hypervOr apply the Home Manager config:
home-manager switch --flake .#jamie@jamie-hypervThe image uses GRUB with EFI (installed as removable, since Hyper-V Gen 2 VMs use UEFI). Filesystems are identified by label (nixos for root, ESP for boot), not by UUID.