about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/cluster/cni/plugins.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/cluster/cni/plugins.nix')
-rw-r--r--nixpkgs/pkgs/applications/networking/cluster/cni/plugins.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/networking/cluster/cni/plugins.nix b/nixpkgs/pkgs/applications/networking/cluster/cni/plugins.nix
new file mode 100644
index 000000000000..6d50c598de7f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/cluster/cni/plugins.nix
@@ -0,0 +1,38 @@
+{ stdenv, lib, fetchFromGitHub, go, removeReferencesTo }:
+
+stdenv.mkDerivation rec {
+  name = "cni-plugins-${version}";
+  version = "0.7.4";
+
+  src = fetchFromGitHub {
+    owner = "containernetworking";
+    repo = "plugins";
+    rev = "v${version}";
+    sha256 = "1sywllwnr6lc812sgkqjdd3y10r82shl88dlnwgnbgzs738q2vp2";
+  };
+
+  buildInputs = [ removeReferencesTo go ];
+
+  buildPhase = ''
+    patchShebangs build.sh
+    export "GOCACHE=$TMPDIR/go-cache"
+    ./build.sh
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mv bin/* $out/bin
+  '';
+
+  preFixup = ''
+    find $out/bin -type f -exec remove-references-to -t ${go} '{}' +
+  '';
+
+  meta = with lib; {
+    description = "Some standard networking plugins, maintained by the CNI team";
+    homepage = https://github.com/containernetworking/plugins;
+    license = licenses.asl20;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ cstrahan ];
+  };
+}