Robertof / nixos-docker-sd-image-builder

Build custom SD images of NixOS for your Raspberry Pi (or any other supported AArch64 device) in 5-20 minutes.
MIT License
214 stars 35 forks source link

Is there a way to add software to the generated image? #30

Closed ri0t closed 2 years ago

ri0t commented 2 years ago

I'm trying to generate "firmware"-SD card images with my own software preinstalled. Is there a way to customize the generated image to contain a set of packages along with their dependencies?

ri0t commented 2 years ago

Aah, i think i have it doing what i need :D :dancers:

Chris2011 commented 2 years ago

Please share with the community how you did this. For example, I added my own config.nix with some stuff. What was your solution?

Robertof commented 2 years ago

Sorry for the late answer! See this issue which might provide some insight about the way things are: https://github.com/Robertof/nixos-docker-sd-image-builder/issues/9

If you just want to add software to the generated image (not the final installed system) you should be able to override environment.systemPackages in sd-image.nix. The base list of packages you can draw your inspiration from is here: https://github.com/NixOS/nixpkgs/blob/d8807d2e2cd92c13f8b75a72f2d3143f65cc6812/nixos/modules/profiles/base.nix

Chris2011 commented 2 years ago

I imported my own config from a git repo to add the software to the generated image. When I have a look into the *.img file all is there. So this works for me :).

Robertof commented 2 years ago

Closing this as I think you brilliantly solved the issue - thanks Chrizzly!