An arctic mirage
To build a MirageOS unikernel with Nix:
# create a flake from Hillingar's default template
$ nix flake new . -t github:/RyanGibb/hillingar
# substitute the name of the unikernel you're building
$ sed -i 's/throw "Put the unikernel name here"/"<unikernel-name>"/g' flake.nix
# build the unikernel with Nix for a particular target
$ nix build .\#<target>
See an example in examples/hello, and build it from the project root with nix build .\?dir=examples/hello
.
If you've already configured your unikernel with mirage configure
and checked in into version control, pass configured = true;
to mkUnikernelPackages
.
Other outputs which may be useful for debugging include:
<target>-configured
: the project after having invokedmirage configure
.<target>-monorepo
: the result of opam monorepo that is provided to the unikernel build in theduniverse
directory.<target>-scope
: the Nixpkgs scope created by an opam solve for thedune build
.<target>
is an alias for<target>-scope.<unikernel-name
.
Where target is one of xen, qubes, unix, macosx, virtio, hvt, spt, muen, or genode.
Read more at ryan.freumh.org/blog/hillingar.
Built on top of tweag/opam-nix/pull/18.