Author of that particular sub-command, nixos-rebuild build-image here. Thanks for posting and sorry for your experience.
So, as you said the feature is pretty new - debuting in 25.05 - and definitely needs a bit more documentation.
The confusing thing here, triggering the error is that you are configuring too much ![]()
nixos-rebuild build-image assumes that you pass it a “normal” or “full” nixos configurations and the name of a “variant” - i.e. in your case an installation iso. It will then merge the image “variant” specific options (here: installation-cd-minimal.nix) with the rest of your configuration and builds an image from that.
The problem here is that you are already one of the “variants”, the installer iso in the toplevel which currently fails with an awful error.
But to proceed and do what you are trying to do you can either:
- Just remove the import of
installation-cd-minimal.nixalltogether and usenixos-rebuild build-image --flake .#iso --image-variant iso-installerto build a customized installer iso (with all the options from your config). - Keep the import, but use the conventional way to build the iso:
nix build .#nixosConfigurations.iso.config.system.build.isoImage.
Both should work, so hope that helps!