05 Dec 2026 I recently migrated my Home Assistant instance from a Home Assistant OS (HAOS) VM on Proxmox to a NixOS VM, also on Proxmox.
What made this migration especially interesting is that it was almost entirely LLM-driven: an agent (Gemini) audited my live HAOS instance, wrote the migration plan, generated the NixOS configuration, built a custom backup-import script, and produced the exact cutover commands.
If you’d like to watch the full walkthrough - including the first-try cutover on Proxmox - you can check out the companion video:
Why leave HAOS? #
I’m in the middle of migrating my Proxmox-based home server over to a NixOS-based home server. My current Proxmox host runs a collection of VMs (mostly running NixOS), and as a prerequisite step, I wanted to migrate the non-NixOS VMs over to NixOS first.
Home Assistant was a clear candidate. Running Home Assistant OS as a VM has been stable and works well out of the box, but it’s heavily UI-driven, and when you inevitably have to drop into YAML, it becomes difficult to track what changed, when, and why. Even more importantly, it’s a bit too abstracted for my taste with the custom shell and Supervisor addons (or apps?) running external services (e.g. Zigbee2MQTT). Moving it to NixOS brings the whole setup into declarative, version-controlled code alongside the rest of my infrastructure.
However, before committing to the move, I wanted to answer a simple question: how feasible is it to migrate my existing HAOS setup to NixOS?
Step 1: AI-driven introspection and feasability planning #
Instead of manually clicking through every settings page in HAOS to take inventory, I handed the discovery work over to Gemini.
I wrote a short, one-paragraph prompt explaining the context along with what I wanted to evaluate. Then - and this was the crucial part - I generated a fresh Home Assistant API key and gave it to the agent, instructing it to poke around and introspect the running instance to figure out what existed today, what could move cleanly to NixOS, and what couldn’t. The Home Assistant API exposes quite a bit, which works well for this kind of workflow.
I want you to scope out the work required to setup HAOS on NixOS. Note that this is NOT part of the current plan, nor do I want you to update the current plan. I just want you to scope things out. HAOS currently doesnt have too many plugins installed: primary ones are Zigbee to MQTT, Shell (probably no longer needed).
UI is available at http://192.168.30.10:8123/, and here is an API token: [REDACTED]
Do whatever digging is needed and report back.
From this, Gemini was able to produe a full migration report (complete with an architecture diagram!) concluding that the migration was not only feasible, but relatively straightforward.
What the LLM uncovered
Giving the agent direct API access let it surface details I might easily have overlooked during a manual audit:
- Versions & resource sizing: It captured the current software versions and VM specs, and correctly noted that a lean NixOS VM could likely run on fewer CPU cores and less RAM than HAOS.
- Dual-NIC VLAN setup: It detected that Home Assistant was using two separate network interfaces for network-level isolation:
- One NIC on my trusted VLAN , used to access the web UI and mobile app.
- A second NIC on a locked-down IoT VLAN , strictly for IoT device discovery.
- One NIC on my
- USB dongle passthrough: It spotted the attachedZigbee USB dongle that would need to be passed through and configured on the NixOS side.(Side note: I’m a huge fan of Zigbee and highly recommend Zigbee devices whenever you have the option.)
- Users: It accounted for the two configured Home Assistant users.
- HAOS Supervisor add-ons: Supervisor add-ons are special companion services that only exist inside HAOS. Gemini zeroed in on these right away and confirmed they could be swapped for native NixOS services, and one could be dropped altogether in favor of standard OpenSSH.
- Devices & integrations: Using the API, it inventoried all devices and integrations and checked that every integration was natively packaged in Nixpkgs.
- Hidden/subtle dependencies: One of its best catches was flagging an automation that copies Nest doorbell clips to an NFS mount. Setting up an NFS mount in NixOS is trivial, of course, but catching that dependencybefore cutover saved me from a silent breakage later.
Step 2: Building the NixOS config in a fresh context #
Once I was happy with the report, I fed the generated plan into a fresh LLM session and had Gemini iterate on the actual implementation.
This is where NixOS really shines for AI-assisted infrastructure work: because the entire system is defined in code, the agent can build the configuration locally and get immediate, deterministic verification before anything ever touches Proxmox.
Working from the plan, Gemini produced three artifacts:
- The NixOS configuration for the Home Assistant VM (covering networking, native NixOS replacements for Supervisor add-ons, NFS mount, and OpenSSH)
- A
disko-based VM disk image ready to import into Proxmox - A tailor-made migration script to extract and import state from a backup of the running HAOS instance into the new VM
Code snippets
{ lib, pkgs, modulesPath, ... }:
{
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
../../shared/default.nix # config shared across all of my machines
./disko.nix
./home-assistant
./proxy.nix # Nginx reverse proxy + LetsEncrypt via Cloudflare DNS
./zigbee.nix
];
ksiksi.users.aksiksi.enable = true;
boot..systemd-boot = {
enable = true;
configurationLimit = 50;
};
boot..efi.canTouchEfiVariables = true;
boot.growPartition = true;
systemd.network.networks = {
"10-lan" = {
matchConfig.MACAddress = "..."; # Trusted VLAN NIC
address = [ "192.168.10.30/24" ];
gateway = [ "192.168.10.1" ];
dns = [ "192.168.10.2" ]; # Pi-hole
};
"11-iot" = {
matchConfig.MACAddress = "..."; # Untrusted VLAN NIC
address = [ "192.168.30.10/24" ];
};
"20-dhcp-fallback" = {
matchConfig.Type = "ether";
networkConfig.DHCP = "yes";
};
};
boot.supportedFilesystems = [ "nfs" ];
environment.systemPackages = [ pkgs.nfs-utils ];
services.rpcbind.enable = true;
systemd.mounts = [
{
type = "nfs";
what = "192.168.10.3:/pool/home";
where = "/mnt/home";
mountConfig.Options = "nfsvers=4,async,noatime,nodiratime,defaults,nofail";
wantedBy = [ "multi-user.target" ];
}
];
services.qemuGuest.enable = true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}
{ ... }:
{
imports = [
./tasks.nix # systemd timers to replace HA scripts/automations
];
services.home-assistant = {
enable = true;
extraComponents = [
"default_config"
"dhcp"
"mobile_app"
"mqtt"
"ssdp"
"usb"
"zeroconf"
];
config = {
default_config = {};
homeassistant = {
allowlist_external_dirs = [ "/mnt/home" ];
};
logger.default = "critical";
automation = "!include automations.yaml";
script = "!include scripts.yaml";
scene = "!include scenes.yaml";
"automation nix" = "!include ${./automations.yaml}";
"script nix" = "!include ${./scripts.yaml}";
"scene nix" = "!include ${./scenes.yaml}";
lovelace.dashboards.zigbee2mqtt-ui = {
mode = "yaml";
title = "Zigbee2MQTT";
icon = "mdi:zigbee";
show_in_sidebar = true;
require_admin = true;
filename = "${./dashboards/z2m.yaml}";
};
};
};
}
{ lib, ... }:
{
disko = {
memSize = 4096;
imageBuilder.imageFormat = "qcow2";
devices.disk.sda = {
type = "disk";
device = lib.mkDefault "/dev/sda";
imageName = "sfax";
imageSize = "32G";
content = {
type = "gpt";
partitions = {
esp = {
name = "ESP";
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = [ "x-systemd.growfs" ];
};
};
};
};
};
};
}
Step 3: Testing with a local VM #
Before shipping the disk image over to Proxmox, NixOS makes it straightforward to go one step beyond a clean evaluation/build: booting the configuration in a local VM. This lets you verify that the system boots cleanly, services start up as expected, and there are no obvious runtime or configuration issues, without touching your running HAOS instance.
nix build .#nixosConfigurations.sfax.config.system.build.diskoImages
nix shell nixpkgs#qemu_kvm -c qemu-img create -f qcow2 -b "$(readlink -f result/sfax.qcow2)" -F qcow2 /tmp/sfax-local.qcow2
nix run nixpkgs#qemu_kvm -- \
-machine q35 -enable-kvm -cpu host -smp 4 -m 4096 \
-display none \
-bios "$(nix build nixpkgs#OVMF.fd --no-link --print-out-paths)/FV/OVMF.fd" \
-device virtio-scsi-pci,id=scsi0 \
-drive file=/tmp/sfax-local.qcow2,if=none,id=hd0,format=qcow2 \
-device scsi-hd,drive=hd0 \
-netdev user,id=net0,hostfwd=tcp::2222-:22,hostfwd=tcp::18123-:8123,hostfwd=tcp::18080-:8080 \
-device virtio-net-pci,netdev=net0
ssh -p 2222 aksiksi@localhost -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "hostname && systemctl is-active mosquitto home-assistant systemd-networkd && ip -br a"
curl -sSI http://localhost:18123/ | head -n 5
Step 4: Live cutover on Proxmox #
Here is how the cutover played out:
rsync -avh --progress --copy-links result/sfax.qcow2 root@192.168.0.100:/tmp/sfax.qcow2
ssh root@192.168.0.100 "qm create 111 --name sfax --ostype l26 --machine q35 --bios ovmf --efidisk0 vmpool:1,efitype=4m,pre-enrolled-keys=0 --scsihw virtio-scsi-single --cores 4 --sockets 1 --memory 4096 --agent 1 --net0 virtio,bridge=vmbr0,firewall=1,tag=10"
ssh root@192.168.0.100 "qm importdisk 111 /tmp/sfax.qcow2 vmpool && rm -f /tmp/sfax.qcow2"
ssh root@192.168.0.100 "qm set 111 --scsi0 vmpool:vm-111-disk-1,iothread=1 --boot order=scsi0 && qm start 111"
nix run nixpkgs#python3 -- hosts/sfax/migrate-backup.py /tmp/manual.tar --deploy aksiksi@<DHCP_IP> --no-start
ssh root@192.168.0.100 "qm shutdown 111 && qm shutdown 101 && qm set 101 --onboot 0"
ssh root@192.168.0.100 "qm set 111 --net0 virtio=[REDACTED],bridge=vmbr0,firewall=1,tag=10 --net1 virtio=[REDACTED],bridge=vmbr0,firewall=1,tag=30 --usb0 host=[REDACTED] --onboot 1 && qm start 111"
ssh root@192.168.0.100 'zfs set sharenfs="sec=sys,rw=@192.168.10.20/32:@192.168.10.10/32:@192.168.10.30/32,crossmnt,no_subtree_check,insecure" pool/home && zfs share -a'
curl -sSI http://192.168.10.30:8123/ | head -n 5
curl -sSI http://192.168.10.30:8080/ | head -n 5
The VM booted cleanly into NixOS on Proxmox.