nixos-generators icon indicating copy to clipboard operation
nixos-generators copied to clipboard

Make this project a module system?

Open DavHau opened this issue 3 years ago • 2 comments

Often my use case is to generate something that is a mixture of different formats available in this project. One example: I currently want to create a usb stick with a base nixos system to use as a target for nixops. Therefore formats raw or raw-efi wuild be suitable. Since I do not know the size of my usb stick yet, I want the root partition to automatically enlarge itself on first boot which is a feature only of the sdimage-aarch64 format. But i don't use aarch64.

It's currently not possible to merge different formats without inheriting lots of unnecessary stuff or getting conflicts.

Wouldn't it be better to make this project a module system? It could have config options like:

  • resizeRootFS = true
  • output-format = raw
  • system = aarch64-linux

...or something like this. This would allow more granular configuration. At the same time the tool could still provide default configurations for these options equivalent to the current formats.

Any thoughts about this?

DavHau avatar Jul 25 '20 11:07 DavHau

I'm currently working on improving the make-disk-image in nixpkgs (which nixos-generators is using). https://github.com/NixOS/nixpkgs/pull/89331 IMHO these modules you describe should reside in nixpkgs. And it would be nice to have similiar options for disk-images as for VMs. In the long run this repository probably should be integrated into nixpkgs.

Also there is fileSystems.<name?>.autoResize which works for all ext2/3/4 filesystems.

Lassulus avatar Jul 25 '20 12:07 Lassulus

@DavHau is this still relevant after your recent modules addition?

mayl avatar Aug 26 '23 05:08 mayl