Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 1.99 KB

README.md

File metadata and controls

53 lines (35 loc) · 1.99 KB

Usage examples

You need to install Nix and enable flakes to use this repo. Examples are structured as an additional Nix flake containing derivations (ie, build recipes, like Dockerfiles) for potential EIFs.

To see the overall plumbing to use the aws-nitro-util flake, see flake.nix.

To see examples for specific EIFs, see the individual package definitions:

Building the examples

To show what examples can be built

nix flake show

To build shellScriptEif for your current architecture:

nix build '.#shellScriptEif'

Note this will produce an aarch64-linux EIF if you are running it in an ARM Mac.

To build for a different architecture via a remote builder

Nix allows compiling 'natively' for other architectures by building in a different machine.

To do this you need to set up a linux remote builder first. This can be any machine you can SSH into, including a VM.

Then, for example, to compile EIFs natively for x86_64-linux on an ARM Mac:

nix build '.#packages.x86_64-linux-crossCompiledEif'

Using remote builders makes builds simpler (because it is a linux x86 machine compiling linux x86 binaries) but requires setting up that additional machine and telling your local Nix installation about it.

To build for a different architecture via cross-compilation

If you do not have remote builders, you can cross-compile. Keep in mind this requires all dependencies of your EIF to be cross-compiled too (which is tricky for bash scripts).

To cross-compile an EIF from your local system to x86_64-linux:

nix build '.#x86_64-linux-crossCompiledEif'