Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ociTools: various improvements #130061

Closed
wants to merge 4 commits into from

Conversation

mikroskeem
Copy link
Member

Motivation for this change

Turns out that ociTools has been broken since the day it was introduced - realatime is incorrect mount option, making none of the OCI-compatible runtimes accept the bundle generated using it.

This PR also introduces a way to specify extra OCI configuration to be merged into bundle's config.json, and makes a minor adjustment to final runCommand step to set image derivation output name which makes more sense.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Relase notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Comment on lines +3 to +7
let
currentSystemSplit = lib.splitString "-" builtins.currentSystem;
currentOS = lib.last currentSystemSplit;
currentArch = lib.head currentSystemSplit;
in
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am pretty sure that there's better way...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid builtins.currentSystem. A drop-in is hostPlatform.system, but you probably want something like hostPlatform.parsed.cpu.name and hostPlatform.parsed.kernel.name.

Seems to match at least for x86-64 and for linux, but I don't know what format buildContainer really needs.

@stale
Copy link

stale bot commented Jan 9, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 9, 2022
@mikroskeem mikroskeem closed this Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 10.rebuild-darwin: 0 10.rebuild-linux: 0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants