nix-community / nixos-generators

Collection of image builders [maintainer=@Lassulus]
MIT License
1.85k stars 146 forks source link

Ability to specify file system? #177

Open onsails opened 2 years ago

onsails commented 2 years ago

I've successfully created a bootable sdcard with sd-image-aarch64-new-kernel-installer.nix module which boots on raspberry pi 4.

However this image is using zfs with bpool and rpool pools. I suppose it happens because the host machine I use to build image is using zfs with exactly the same pools. Is it possible to change file system to ext4?

n8henrie commented 2 years ago

+1 -- just came to create an issue about filesystems.

I've been tinkering with a BTRFS-based Raspberry Pi 3 image for quite a while now: https://github.com/n8henrie/nixos-btrfs-pi

I'm able to get an image that boots and works fine from the linked repo, but it takes an hour or so. I created a flake using nixos-generators that takes the same configuration.nix, mounts the resulting image, and copies everything onto a BTRFS layout in a VM (also tried with btrfs-convert). It creates the image much more quickly, which is great, but the resulting image won't boot for some reason. If nixos-generators natively supported a configurable filesystem I might be in business.

Lassulus commented 2 years ago

hmm, we could try to add a script option to make-disk-image.nix (in nixpkgs) we then could use for example https://github.com/nix-community/disko to create whatever filesystem/bootloader combination we would want?

arjan-s commented 11 months ago

Agreed, disko support would be awesome!

Lassulus commented 11 months ago

there is now an image builder in disko: https://github.com/nix-community/disko/blob/master/docs/reference.md#generating-disk-images-with-secrets-included-using-disko

znd4 commented 2 months ago

there is now an image builder in disko: https://github.com/nix-community/disko/blob/master/docs/reference.md#generating-disk-images-with-secrets-included-using-disko

new link