diff --git a/pkgs/tools/networking/flannel/default.nix b/pkgs/tools/networking/flannel/default.nix new file mode 100644 index 000000000000..be6d1658d3e5 --- /dev/null +++ b/pkgs/tools/networking/flannel/default.nix @@ -0,0 +1,30 @@ +{ stdenv, lib, go, fetchurl, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }: + +stdenv.mkDerivation rec { + version = "0.1.0"; + name = "flannel-${version}"; + + src = import ./deps.nix { + inherit stdenv lib fetchFromGitHub; + }; + + buildInputs = [ go ]; + + buildPhase = '' + export GOPATH=$src + go build -v -o flannel github.com/coreos/flannel + ''; + + installPhase = '' + mkdir -p $out/bin + mv flannel $out/bin/flannel + ''; + + meta = with stdenv.lib; { + description = "Flannel is an etcd backed network fabric for containers"; + homepage = https://github.com/coreos/flannel; + license = licenses.asl20; + maintainers = with maintainers; [ offline ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/tools/networking/flannel/deps.nix b/pkgs/tools/networking/flannel/deps.nix new file mode 100644 index 000000000000..3af2404ba784 --- /dev/null +++ b/pkgs/tools/networking/flannel/deps.nix @@ -0,0 +1,28 @@ +# This file was generated by go2nix. +{ stdenv, lib, fetchFromGitHub }: + +let + goDeps = [ + { + root = "github.com/coreos/flannel"; + src = fetchFromGitHub { + owner = "coreos"; + repo = "flannel"; + rev = "cd584fa5e1545ae86c965588e81ceb24455e980d"; + sha256 = "1f7x6a2c8ix6j5y1r0dq56b58bl2rs2ycbdqb9fz5zv1zk2w20rd"; + }; + } + ]; + +in + +stdenv.mkDerivation rec { + name = "go-deps"; + + buildCommand = + lib.concatStrings + (map (dep: '' + mkdir -p $out/src/`dirname ${dep.root}` + ln -s ${dep.src} $out/src/${dep.root} + '') goDeps); +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4474df69a613..66039f052331 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1134,6 +1134,8 @@ let fdm = callPackage ../tools/networking/fdm {}; + flannel = callPackage ../tools/networking/flannel { }; + figlet = callPackage ../tools/misc/figlet { }; file = callPackage ../tools/misc/file { };