Open
Conversation
this allows us to `-j vm.json` unconditionally
Contributor
Author
|
For reference, this is a flake.nix I use in a unikernel: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on includeos/vmrunner#49.
This PR adds flake support to IncludeOS, allowing users to build the kernel, and build+run their unikernel through the flake interface. This reduces the pipeline of running the example unikernel to
nix run .#example, which handles all the rebuilding.Furthermore, this allows standalone unikernels to be able to make their own
nix runwrappers which will propagate inputs automatically.There are no changes for non-flake users, and tests are still using the old mechanisms. This support is just added as a convenience, for now. We expose the following:
nix buildwhich simply rebuilds IncludeOSnix build .#chainloaderwill build the chainloadernix build .#examplewill build the unikernel from./example/.nix run .#examplebuilds and runs the example unikernel image.nix run . -- ./path/to/resultwill runboot -j vm.json result.elf.binfrom an already built unikernel.This approach allows us to override inputs both locally and remotely:
--override-input vmrunner ~/path/to/vmrunner--override-input vmrunner github:mazunki/vmrunnerAnd IncludeOS itself doesn't need to be cloned. This "just works":
nix run github:mazunki/includeos/flakify#example.Note that
mkUnikernel.nixis largely the same asunikernel.nix, but rewritten in a way that makes sense for flakes. Eventually, I'm not sure it makes sense to keep both.