From 54121ff3173b83c8e88accdcdb02807518ceca55 Mon Sep 17 00:00:00 2001 From: 06kellyjac Date: Sun, 13 Dec 2020 12:22:45 +0000 Subject: [PATCH] nerdctl: init at 0.2.0 --- .../networking/cluster/nerdctl/default.nix | 51 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/applications/networking/cluster/nerdctl/default.nix diff --git a/pkgs/applications/networking/cluster/nerdctl/default.nix b/pkgs/applications/networking/cluster/nerdctl/default.nix new file mode 100644 index 000000000000..050c414ce1e9 --- /dev/null +++ b/pkgs/applications/networking/cluster/nerdctl/default.nix @@ -0,0 +1,51 @@ +{ lib +, buildGoModule +, fetchFromGitHub +, makeWrapper +, buildkit +, cni-plugins +, extraPackages ? [] +}: + +let + binPath = lib.makeBinPath ([ + buildkit + ] ++ extraPackages); +in +buildGoModule rec { + pname = "nerdctl"; + version = "0.2.0"; + + src = fetchFromGitHub { + owner = "AkihiroSuda"; + repo = pname; + rev = "v${version}"; + sha256 = "181qapqgp7zd0imk0zkn4wzpsw292ai2yz9pbiirpjcjx9h26w5h"; + }; + + vendorSha256 = "0scywhllxk1m6456wggdmn7sgvy5x3gz2xnyfq9jnvvzap8byr2v"; + + nativeBuildInputs = [ makeWrapper ]; + + buildFlagsArray = [ + "-ldflags=" + "-w" + "-s" + "-X github.com/AkihiroSuda/nerdctl/pkg/version.Version=v${version}" + "-X github.com/AkihiroSuda/nerdctl/pkg/version.Revision=" + ]; + + postInstall = '' + wrapProgram $out/bin/nerdctl \ + --prefix PATH : "${binPath}" \ + --prefix CNI_PATH : "${cni-plugins}/bin" + ''; + + meta = with lib; { + description = "A Docker-compatible CLI for containerd"; + homepage = src.meta.homepage; + license = licenses.asl20; + platforms = platforms.linux; + maintainers = with maintainers; [ jk ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index de1c965e9c0d..923b725701f1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5311,6 +5311,8 @@ in ncrack = callPackage ../tools/security/ncrack { }; + nerdctl = callPackage ../applications/networking/cluster/nerdctl { }; + netdata = callPackage ../tools/system/netdata { inherit (darwin.apple_sdk.frameworks) CoreFoundation IOKit; };