Looking for instructions on how to build NixOS for OCI cloud images

Hi.
I’m looking for instructions on how to build a OCI image to upload to oracle cloud custom images.
I found this pull request, oci-image: init scripts to build and upload image by ilian · Pull Request #119856 · NixOS/nixpkgs · GitHub but I am not clear on how to use it.

I have NixOS installed locally on an x86_64-linux system, but would like to generate two separate images to use on oracle, one x86_64-linux for the micro instance and one for A1 instance that is aarch64-linux

Any help here in pointing me in the right direction would be appreciated.

1 Like

I’m on a train right now so I can’t give too detailed a response, but it should be a simple case of running:

nix-build '<nixpkgs/nixos>' -A config.system.build.OCIImage --argstr system x86_64-linux --option system-features kvm -o oci-image
1 Like

Ok - Thank you will try this, and see where it gets me.
Appreciate someone reaching out with a response.
I’ve been trying to figure this out for close to 5 days now.

I’m not sure if I’m just not getting something. But this is the results I get when I run that.

I’m sure I’m just missing something, I just don’t know what.

https://gist.github.com/cjemorton/75296978cfcf8ee5cfcfeaf134024926

Just a guess:

config.system.build.ociImage