Skip to content

nerdctl: enable darwin and fix default data-root permission issue#508463

Draft
66Ton99 wants to merge 3 commits intoNixOS:masterfrom
66Ton99:ton/nerdctl-darwin
Draft

nerdctl: enable darwin and fix default data-root permission issue#508463
66Ton99 wants to merge 3 commits intoNixOS:masterfrom
66Ton99:ton/nerdctl-darwin

Conversation

@66Ton99
Copy link
Copy Markdown

@66Ton99 66Ton99 commented Apr 9, 2026

Summary

This updates pkgs/by-name/ne/nerdctl/package.nix to make nerdctl usable on Darwin.

Changes

  • enable Darwin in meta.platforms
  • make Linux-only CNI integration conditional:
    • cni-plugins is optional
    • CNI_PATH wrapper env is set only on Linux
  • fix Darwin runtime behavior where nerdctl fails with:
    • mkdir /var/lib/nerdctl: permission denied
  • for Darwin, patch upstream default data root to:
    • $HOME/.local/share/nerdctl
    • fallback to /var/lib/nerdctl if home cannot be resolved
  • keep completion generation working in build sandbox by invoking completion with a temporary data-root

Why

nerdctl currently evaluates/builds as Linux-only and on Darwin defaults to /var/lib/nerdctl, which is not writable for regular users and causes immediate fatal startup.

Result

On Darwin, nerdctl can be installed and started as a normal user without requiring root-writable /var/lib.

Testing

Tested on x86_64-darwin:

  • nix build ...#nerdctl succeeds
  • nerdctl --version succeeds
  • running nerdctl no longer fails with /var/lib/nerdctl: permission denied

Linux behavior is unchanged (Linux-only CNI wiring remains Linux-only).

Review request

I would appreciate review from someone who is familiar with both nerdctl internals and nixpkgs packaging conventions, especially around Darwin defaults and runtime data-root behavior.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle! labels Apr 9, 2026
@66Ton99
Copy link
Copy Markdown
Author

66Ton99 commented Apr 9, 2026

Related upstream/downstream work:

Once the upstream nerdctl change lands and is released, this nixpkgs change can be simplified accordingly.

@66Ton99 66Ton99 force-pushed the ton/nerdctl-darwin branch from 3e99ba1 to 1d271e0 Compare April 9, 2026 23:39
@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Apr 9, 2026
@AkihiroSuda
Copy link
Copy Markdown

make nerdctl usable on Darwin.

Not really useful until we can have a functional runtime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants