NixOS Generator Deprecation - Unable to replicate the declarative Proxmox VM builds (Not LXC!)

I am unable to replicate my workflow where I would create a configuration.nix file of the virtual machine I want to create by using the following command.

nixos-generate -f proxmox -c config-to-proxmox-vm.nix --system x86_64-linux --disk-size 9000 

Where I would try to find and copy the /nix/store/[^ ]*vma.zst file which has been created and then copy it over to the Proxmox in the /var/lib/vzdump

But now that the GitHub - nix-community/nixos-generators: Collection of image builders [maintainer=@Lassulus] has been deprecated over using nixos-rebuild build-image --image-variant proxmox, where if I run the command of the

NIXOS_CONFIG="/path/to/config-to-proxmox-vm.nix " nixos-rebuild build-image --image-variant proxmox

It instead tries to apparently run the iPXE, which looks quite unexpected thing and as expectedly it fails and produces the…

> [  104.912947] Rebooting in 1 seconds..
> [2026-02-05T17:52:44Z INFO  virtiofsd] Client disconnected, shutting down
> [2026-02-05T17:52:44Z INFO  virtiofsd] Client disconnected, shutting down
> Virtual machine didn't produce an exit code.

Which previously it just built the image and it didn’t produce anything. Looking in the /nix/store I don’t find anything to look into.

Is there a better way to have declarative NixOS builds in Proxmox or am I forced to keep the deprecated repository in use manually by the usual building it?

Also it looks like there is nothing to document about the disk-size variable as well when it was possible before.

Now having double checked the NixOS configuration, upgraded the NixOS machine in question, I had seen that when I had set to this…

  # Bootloader - OVMF
  boot.loader.grub.enable = lib.mkForce false;
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = false;
  boot.loader.efi.efiSysMountPoint = "/boot";

  # Proxmox configuration
  proxmox.qemuConf = {
    bios = "ovmf"; # Use OVMF for UEFI
  };
  boot.initrd.availableKernelModules = ["virtio_pci" "virtio_scsi" "ahci" "sd_mod"];

It would have cause this…

error:
       … while calling the 'attrNames' builtin
         at «string»:6:3:
            5| in
            6|   builtins.attrNames set.config.system.build.images
             |   ^
            7|

       … while evaluating the attribute 'config.system.build.images'
         at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/default.nix:19:23:
           18| {
           19|   inherit (eval) pkgs config options;
             |                       ^
           20|

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: The option `virtualisation.proxmox' does not exist. Definition values:
       - In `/home/nixosbm/manual_builds/forgejo.nix':
           {
             qemuConf = {
               bios = "ovmf";
             };
           }


Which is weird because I would have expected this to be 1:1 nixos-generate package that was deprecated even if it was merged upstream.

Even though I can see this existing in the upstream kinda, but I don’t know how to exactly import it.


So in the meanwhile I though to well go to SeaBIOS then, but when the following settings…

  # Bootloader - GRUB for Legacy BIOS
  boot.loader.systemd-boot.enable = lib.mkForce false;
  boot.loader.grub = {
    enable = true;
    device = "/dev/vda";  # Install GRUB to the disk
    efiSupport = false;   # Disable UEFI
  };
  boot.initrd.availableKernelModules = ["virtio_pci" "virtio_scsi" "ahci" "sd_mod"];
  # Force Disk Size to 96GB to avoid Proxmox issues with resizing
  virtualisation.diskSize = 96 * 954; # 96GB in MiB

It would fail with the following

ERROR: cptofs failed. diskSize might be too small for closure.
error: builder for '/nix/store/g9z0sgr88s0q24bm84286lyai6d03ngw-proxmox-nixos-25.11.5198.e576e3c9cf9b.drv' failed with exit code 1;
       last 25 log lines:
       > [   35.066259] Mem-Info:
       > [   35.066263] active_anon:0 inactive_anon:0 isolated_anon:0
       > [   35.066263]  active_file:7923 inactive_file:7924 isolated_file:0
       > [   35.066263]  unevictable:0 dirty:47 writeback:0
       > [   35.066263]  slab_reclaimable:5086 slab_unreclaimable:2842
       > [   35.066263]  mapped:0 shmem:0 pagetables:0
       > [   35.066263]  sec_pagetables:0 bounce:0
       > [   35.066263]  kernel_misc_reclaimable:0
       > [   35.066263]  free:1315 free_pcp:0 free_cma:0
       > [   35.066277] Node 0 active_anon:0kB inactive_anon:0kB active_file:31692kB inactive_file:31696kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:0kB dirty:188kB writeback:0kB shmem:0kB writeback_tmp:0kB kernel_stack:116kB pagetables:0kB sec_pagetables:0kB all_unreclaimable? yes
       > [   35.066286] Normal free:5260kB boost:4096kB min:5364kB low:5680kB high:5996kB reserved_highatomic:0KB active_anon:0kB inactive_anon:0kB active_file:31692kB inactive_file:31696kB unevictable:0kB writepending:188kB present:102400kB managed:100768kB mlocked:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
       > [   35.066314] lowmem_reserve[]: 0 0
       > [   35.066320] Normal: 19*4kB (U) 280*8kB (UE) 126*16kB (UE) 23*32kB (UE) 3*64kB (U) 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 5260kB
       > [   35.066337] 15847 total pagecache pages
       > [   35.066342] 25600 pages RAM
       > [   35.066346] 0 pages HighMem/MovableOnly
       > [   35.066349] 408 pages reserved
       > [   35.066352] Tasks state (memory values in pages):
       > [   35.066357] [  pid  ]   uid  tgid total_vm      rss pgtables_bytes swapents oom_score_adj name
       > [   35.066363] Out of memory and no killable processes...
       > [   35.066390] Kernel panic - not syncing: System is deadlocked on memory
       > [   35.066397] ---[ end Kernel panic - not syncing: System is deadlocked on memory ]---
       > cptofs: lib/posix-host.c:448: panic: Assertion `0' failed.
       > /nix/store/89c2y24wj6z3q7ab153wc68qjgjbkn14-vm-run: line 132:  1379 Aborted                    (core dumped) cptofs -p -P 1 -t ext4 -i $diskImage $root/* /


> ERROR: cptofs failed. diskSize might be too small for closure.

Which is super weird that 96GB would not be enough, but strangest thing even I had put the config there, it would yell at me for this

trace: evaluation warning: Obsolete option `proxmox.qemuConf.diskSize' is used. It was renamed to `virtualisation.diskSize'.

Which means that something is very much up with the proxmox image building with nixos-rebuild build-image --image-variant proxmox

Apologies, when running the full-trace of the old build machine, it indeed does run iPXE, but only if I had run with full-trace

:woman_facepalming: on my part at myself.

I guess TIL how it actually guarantees that it runs as it is supposed to.


Also another big derp and future warning for you all

virtualisation.diskSize = 98304; # 96GB in MiB

This will create an .vmz.zst file that is 103GB initially, so if you do not have this amount of diskspace…

You will be in a world of hurt, as it assumes you have that amount of diskspace. Which actually makes a lot of sense, as you it creates a backup file with everything included, including empty space.

Completely my bad on my part.


I will leave it open of what to do when people want to still use OVMF instead of SeaBIOS but unable to due to deprecation.