Skip to content

Commit 8fef2a4

Browse files
Ton Sharp66Ton99
authored andcommitted
nerdctl: enable darwin and avoid completion data-root permission issues
1 parent 19bc9bb commit 8fef2a4

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

pkgs/by-name/ne/nerdctl/package.nix

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
lib,
3+
stdenv,
34
buildGoModule,
45
fetchFromGitHub,
56
makeWrapper,
67
installShellFiles,
78
buildkit,
8-
cni-plugins,
9+
cni-plugins ? null,
910
writableTmpDirAsHomeHook,
1011
versionCheckHook,
1112
extraPackages ? [ ],
@@ -50,13 +51,14 @@ buildGoModule (finalAttrs: {
5051

5152
postInstall = ''
5253
wrapProgram $out/bin/nerdctl \
53-
--prefix PATH : "${lib.makeBinPath ([ buildkit ] ++ extraPackages)}" \
54-
--prefix CNI_PATH : "${cni-plugins}/bin"
54+
--prefix PATH : "${lib.makeBinPath ([ buildkit ] ++ extraPackages)}"${lib.optionalString stdenv.hostPlatform.isLinux '' \
55+
--prefix CNI_PATH : "${cni-plugins}/bin"''}
5556
57+
mkdir -p "$TMPDIR/nerdctl-data"
5658
installShellCompletion --cmd nerdctl \
57-
--bash <($out/bin/nerdctl completion bash) \
58-
--fish <($out/bin/nerdctl completion fish) \
59-
--zsh <($out/bin/nerdctl completion zsh)
59+
--bash <($out/bin/nerdctl --data-root "$TMPDIR/nerdctl-data" completion bash) \
60+
--fish <($out/bin/nerdctl --data-root "$TMPDIR/nerdctl-data" completion fish) \
61+
--zsh <($out/bin/nerdctl --data-root "$TMPDIR/nerdctl-data" completion zsh)
6062
'';
6163

6264
doInstallCheck = true;
@@ -82,6 +84,6 @@ buildGoModule (finalAttrs: {
8284
developer-guy
8385
jk
8486
];
85-
platforms = lib.platforms.linux;
87+
platforms = lib.platforms.linux ++ lib.platforms.darwin;
8688
};
8789
})

0 commit comments

Comments
 (0)