diff --git a/pkgs/applications/networking/cluster/cni/plugins-deps.nix b/pkgs/applications/networking/cluster/cni/plugins-deps.nix new file mode 100644 index 000000000000..a6bbd333be43 --- /dev/null +++ b/pkgs/applications/networking/cluster/cni/plugins-deps.nix @@ -0,0 +1,210 @@ +# file generated from go.mod using vgo2nix (https://github.com/adisbladis/vgo2nix) +[ + { + goPackagePath = "github.com/Microsoft/go-winio"; + fetch = { + type = "git"; + url = "https://github.com/Microsoft/go-winio"; + rev = "v0.4.11"; + sha256 = "14y1gryr3pb3zy09v2g8dh89m363rfd9sch0wgbabh531hfx72vn"; + }; + } + { + goPackagePath = "github.com/Microsoft/hcsshim"; + fetch = { + type = "git"; + url = "https://github.com/Microsoft/hcsshim"; + rev = "v0.7.4"; + sha256 = "0hky9p6xvkkx2jfkd4fy2d6iaikvlzalyw67gypyqyxygf2hsshg"; + }; + } + { + goPackagePath = "github.com/alexflint/go-filemutex"; + fetch = { + type = "git"; + url = "https://github.com/alexflint/go-filemutex"; + rev = "72bdc8eae2ae"; + sha256 = "082y6y9zv40q3kaqvsv6fyaw2fc42j0sn9z0dl9rbiz4szixj3c4"; + }; + } + { + goPackagePath = "github.com/buger/jsonparser"; + fetch = { + type = "git"; + url = "https://github.com/buger/jsonparser"; + rev = "f4dd9f5a6b44"; + sha256 = "12qa2n33s7yz88ywpr3k9kg3b4gm6rqgnv28iyikyxw8h5jascz5"; + }; + } + { + goPackagePath = "github.com/containernetworking/cni"; + fetch = { + type = "git"; + url = "https://github.com/containernetworking/cni"; + rev = "v0.7.0"; + sha256 = "15ad323dw44k82bfx9r8w5q2kn7jix60p9v4ciyzx2p5pip36wp8"; + }; + } + { + goPackagePath = "github.com/coreos/go-iptables"; + fetch = { + type = "git"; + url = "https://github.com/coreos/go-iptables"; + rev = "v0.4.1"; + sha256 = "0id1npqw3rd5rrkslf6i9yy6lpmd7l5qcglln38g85ylq7inysyi"; + }; + } + { + goPackagePath = "github.com/coreos/go-systemd"; + fetch = { + type = "git"; + url = "https://github.com/coreos/go-systemd"; + rev = "39ca1b05acc7"; + sha256 = "1kzqrrzqspa5qm7kwslxl3m16lqzns23c24rv474ajzwmj3ixmx1"; + }; + } + { + goPackagePath = "github.com/d2g/dhcp4"; + fetch = { + type = "git"; + url = "https://github.com/d2g/dhcp4"; + rev = "f0e4d29ff023"; + sha256 = "07gn9bjvnlfz2jv9wdq3gxxxm9lpwgrwk8z65072jdrz9rs9izpr"; + }; + } + { + goPackagePath = "github.com/d2g/dhcp4client"; + fetch = { + type = "git"; + url = "https://github.com/d2g/dhcp4client"; + rev = "bed07e1bc5b8"; + sha256 = "0kyjalv1kah7sk3i96abg71cgy5s9kzpff2zc7mwj69vicbj7mi3"; + }; + } + { + goPackagePath = "github.com/d2g/dhcp4server"; + fetch = { + type = "git"; + url = "https://github.com/d2g/dhcp4server"; + rev = "477b11cea4dc"; + sha256 = "010dpw6cxrsm6dm49w1q6qpz5xz3lbi5viz6wywxk49fxvnzmx9l"; + }; + } + { + goPackagePath = "github.com/godbus/dbus"; + fetch = { + type = "git"; + url = "https://github.com/godbus/dbus"; + rev = "885f9cc04c9c"; + sha256 = "0wjpaj4vr5lvpnwc5faf3qizd7zd2v9yq0fm0558wap1hiyqb8x8"; + }; + } + { + goPackagePath = "github.com/j-keck/arping"; + fetch = { + type = "git"; + url = "https://github.com/j-keck/arping"; + rev = "2cf9dc699c56"; + sha256 = "1bid8mpx3j4546ni0a6q5xyz7hb854g95qnxqmg5jzs9vrcird3c"; + }; + } + { + goPackagePath = "github.com/juju/errors"; + fetch = { + type = "git"; + url = "https://github.com/juju/errors"; + rev = "22422dad46e1"; + sha256 = "1766ys24y9qgngaqbx0g84lmh54b3369v8hk5fa1k8si2d34fxas"; + }; + } + { + goPackagePath = "github.com/mattn/go-shellwords"; + fetch = { + type = "git"; + url = "https://github.com/mattn/go-shellwords"; + rev = "v1.0.3"; + sha256 = "1pg7pl25wvpl2dbpyrv9p1r7prnqimxlf6136vn0dfm54j2x4mnr"; + }; + } + { + goPackagePath = "github.com/onsi/ginkgo"; + fetch = { + type = "git"; + url = "https://github.com/onsi/ginkgo"; + rev = "7f8ab55aaf3b"; + sha256 = "0nas6wqdym4jx42kw9wj80b58r69k9qhnvglz009lj34g5gba7rw"; + }; + } + { + goPackagePath = "github.com/onsi/gomega"; + fetch = { + type = "git"; + url = "https://github.com/onsi/gomega"; + rev = "2152b45fa28a"; + sha256 = "0amjlkawp84mmdqjgdamf93p1546cla6h4wwrx7hf5r862r2qcw2"; + }; + } + { + goPackagePath = "github.com/safchain/ethtool"; + fetch = { + type = "git"; + url = "https://github.com/safchain/ethtool"; + rev = "42ed695e3de8"; + sha256 = "0n5hkrzc1bh46nidcssx4539kvcmgj501v3kzh2pljpg27509daj"; + }; + } + { + goPackagePath = "github.com/sirupsen/logrus"; + fetch = { + type = "git"; + url = "https://github.com/sirupsen/logrus"; + rev = "v1.0.6"; + sha256 = "029irw2lsbqi944gdrbkwdw0m2794sqni4g21gsnmz142hbzds8c"; + }; + } + { + goPackagePath = "github.com/vishvananda/netlink"; + fetch = { + type = "git"; + url = "https://github.com/vishvananda/netlink"; + rev = "023a6dafdcdf"; + sha256 = "1i5q8r8rg7lxzvq2vhbf25lrkzdlgficfv0bxg9rf7cgg6z819sn"; + }; + } + { + goPackagePath = "github.com/vishvananda/netns"; + fetch = { + type = "git"; + url = "https://github.com/vishvananda/netns"; + rev = "13995c7128cc"; + sha256 = "1zk6w8158qi4niva5rijchbv9ixgmijsgqshh54wdaav4xrhjshn"; + }; + } + { + goPackagePath = "golang.org/x/crypto"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/crypto"; + rev = "7c1a557ab941"; + sha256 = "1f1q9mby8m7ws3gbj90v0prhnf4g2sgf74azmw31kzwd6azlar3m"; + }; + } + { + goPackagePath = "golang.org/x/net"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/net"; + rev = "49bb7cea24b1"; + sha256 = "111q4qm3hcjvzvyv9y5rz8ydnyg48rckcygxqy6gv63q618wz6gn"; + }; + } + { + goPackagePath = "golang.org/x/sys"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/sys"; + rev = "66b7b1311ac8"; + sha256 = "00ny4r2bbj6rz939iy9g699acqydq7rfi6r6awn25w9i2dld9m13"; + }; + } +] diff --git a/pkgs/applications/networking/cluster/cni/plugins.nix b/pkgs/applications/networking/cluster/cni/plugins.nix index b5276818f79f..8956828fa763 100644 --- a/pkgs/applications/networking/cluster/cni/plugins.nix +++ b/pkgs/applications/networking/cluster/cni/plugins.nix @@ -1,6 +1,5 @@ -{ stdenv, lib, fetchFromGitHub, go, removeReferencesTo }: - -stdenv.mkDerivation rec { +{ stdenv, lib, fetchFromGitHub, go, removeReferencesTo, buildGoPackage }: +buildGoPackage rec { pname = "cni-plugins"; version = "0.8.2"; @@ -11,28 +10,31 @@ stdenv.mkDerivation rec { sha256 = "0gyxa6mhiyxqw4wpn6r7wgr2kyvflzbdcqsk5ch0b6zih98144ia"; }; - buildInputs = [ removeReferencesTo go ]; - - buildPhase = '' - patchShebangs build_linux.sh - export "GOCACHE=$TMPDIR/go-cache" - ./build_linux.sh - ''; - - installPhase = '' - mkdir -p $out/bin - mv bin/* $out/bin - ''; - - preFixup = '' - find $out/bin -type f -exec remove-references-to -t ${go} '{}' + - ''; - + goDeps = ./plugins-deps.nix; + goPackagePath = "github.com/containernetworking/plugins"; + subPackages = [ + "plugins/meta/bandwidth" + "plugins/meta/firewall" + "plugins/meta/flannel" + "plugins/meta/portmap" + "plugins/meta/sbr" + "plugins/meta/tuning" + "plugins/main/bridge" + "plugins/main/host-device" + "plugins/main/ipvlan" + "plugins/main/loopback" + "plugins/main/macvlan" + "plugins/main/ptp" + "plugins/main/vlan" + "plugins/ipam/dhcp" + "plugins/ipam/host-local" + "plugins/ipam/static" + ]; 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" ]; + platforms = platforms.linux; maintainers = with maintainers; [ cstrahan ]; }; }