Skip to content

Conversation

quinneden
Copy link
Contributor

@quinneden quinneden commented May 12, 2025

This pull request removes the nixos-generators flake input and refactors the code to directly use the config.system.build.images.qemu-efi module that is built-in to the NixOS configuration instead of relying on nixes-generators.nixosGenerate. This change simplifies the image configuration and eliminates the need for any external flake inputs besides nixpkgs.

Removal of nixos-generators:

  • flake.nix, flake.lock: Removed nixos-generators from inputs and updated lock file. [1]
  • package.nix: Removed the call to nixos-generators.nixosGenerate and instead call nixpkgs.lib.nixosSystem under an attribute set named imageConfig. [1] [2] [3] [4]

Image Path Adjustment:

  • module.nix: Updated the image location path in vmYaml to use imageWithFinalConfig.passthru.filePath instead of the hardcoded nixos.qcow2, as the filename of the image built using the images module is much longer and will change since it includes the nixpkgs version.

I've tested this configuration in my own nix-darwin config and have had no issues rebuilding the image and running the vm with the exact same module configuration as before.

Remove `nixos-generators` from flake inputs. Refactor `package.nix` from
using the `nixos-generators.nixosGenerate` function to using the built-in
`config.system.build.images.qemu-efi` attribute. This simplifies the
configuration of the image and removes the need for any external flake inputs.
@quinneden quinneden changed the title refactor(image): migrate off of nixos-generators refactor: migrate off of nixos-generators May 12, 2025
@quinneden quinneden changed the title refactor: migrate off of nixos-generators image: migrate off of nixos-generators May 12, 2025
@kivikakk
Copy link

Tested as working well and with no changes likewise (except a nixpkgs bump to get config.system.build.images).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants