diff --git a/pkgs/servers/consul/deps.nix b/pkgs/servers/consul/deps.nix index fcfc3e911ec8..4faf1d3abc23 100644 --- a/pkgs/servers/consul/deps.nix +++ b/pkgs/servers/consul/deps.nix @@ -56,6 +56,24 @@ let sha256 = "0fqrhmzi0jbbwylv7c1l0ywqr67aqlv6s891f4inp0y4abd7shc7"; }; } + { + root = "github.com/hashicorp/go-multierror"; + src = fetchFromGitHub { + owner = "hashicorp"; + repo = "go-multierror"; + rev = "fcdddc395df1ddf4247c69bd436e84cfa0733f7e"; + sha256 = "1gvrm2bqi425mfg55m01z9gppfd7v4ljz1z8bykmh2sc82fj25jz"; + }; + } + { + root = "github.com/hashicorp/consul-template"; + src = fetchFromGitHub { + owner = "hashicorp"; + repo = "consul-template"; + rev = "v0.5.1"; + sha256 = "1h8sqmzf73bn12bj1yqldp9gl46gz766c3zrymwgl8p0mb74dllf"; + }; + } { root = "github.com/hashicorp/go-checkpoint"; src = fetchFromGitHub { diff --git a/pkgs/servers/consul/template.nix b/pkgs/servers/consul/template.nix new file mode 100644 index 000000000000..2b44fc8b8a6f --- /dev/null +++ b/pkgs/servers/consul/template.nix @@ -0,0 +1,29 @@ +{ stdenv, lib, go, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }: + +stdenv.mkDerivation rec { + name = "consul-template-${version}"; + version = "0.5.1"; + + src = import ./deps.nix { + inherit stdenv lib fetchgit fetchhg fetchbzr fetchFromGitHub; + }; + + buildInputs = [ go ]; + + buildPhase = '' + GOPATH=$src go build -v -o consul-template github.com/hashicorp/consul-template + ''; + + installPhase = '' + mkdir -p $out/bin + cp consul-template $out/bin + ''; + + meta = with lib; { + description = "Generic template rendering and notifications with Consul"; + homepage = https://github.com/hashicorp/consul-template; + license = licenses.mpl20; + maintainers = with maintainers; [ puffnfresh ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e3c3e66156f0..e5e94cedc051 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -713,6 +713,8 @@ let consul-alerts = callPackage ../servers/consul/alerts.nix { }; + consul-template = callPackage ../servers/consul/template.nix { }; + corosync = callPackage ../servers/corosync { }; cherrytree = callPackage ../applications/misc/cherrytree { };