2014-09-11 22:35:18 +00:00
|
|
|
{ stdenv, lib, go, fetchgit, fetchhg, fetchbzr, fetchFromGitHub
|
2014-12-31 02:05:00 +00:00
|
|
|
, ruby, nodejs, loadRubyEnv }:
|
2014-06-15 22:08:44 +00:00
|
|
|
|
|
|
|
let
|
2014-11-17 21:18:23 +00:00
|
|
|
version = "0.4.1";
|
2014-11-18 03:06:56 +00:00
|
|
|
rubyEnv = loadRubyEnv { gemset = ./gemset.nix; };
|
2014-06-15 22:08:44 +00:00
|
|
|
in
|
|
|
|
|
2014-09-11 22:35:18 +00:00
|
|
|
with lib;
|
2014-06-15 22:08:44 +00:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "consul-${version}";
|
|
|
|
|
|
|
|
src = import ./deps.nix {
|
|
|
|
inherit stdenv lib fetchgit fetchhg fetchbzr fetchFromGitHub;
|
|
|
|
};
|
|
|
|
|
2014-11-18 03:06:56 +00:00
|
|
|
buildInputs = [ go ruby rubyEnv.sass rubyEnv.uglifier nodejs ];
|
2014-06-15 22:08:44 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
2014-09-11 22:35:18 +00:00
|
|
|
# Build consul binary
|
2014-06-15 22:08:44 +00:00
|
|
|
export GOPATH=$src
|
|
|
|
go build -v -o consul github.com/hashicorp/consul
|
2014-09-11 22:35:18 +00:00
|
|
|
|
|
|
|
# Build ui static files
|
|
|
|
({
|
|
|
|
cp -r src/github.com/hashicorp/consul/ui .
|
|
|
|
cd ui
|
|
|
|
chmod -R u+w .
|
|
|
|
make dist
|
|
|
|
})
|
2014-06-15 22:08:44 +00:00
|
|
|
'';
|
|
|
|
|
2014-09-11 22:35:18 +00:00
|
|
|
outputs = [ "out" "ui" ];
|
|
|
|
|
2014-06-15 22:08:44 +00:00
|
|
|
installPhase = ''
|
2014-09-11 22:35:18 +00:00
|
|
|
# Install consul binary
|
|
|
|
mkdir -p $out/bin
|
2014-06-15 22:08:44 +00:00
|
|
|
cp consul $out/bin
|
2014-09-11 22:35:18 +00:00
|
|
|
|
|
|
|
# Install ui static files
|
|
|
|
mkdir -p $ui
|
|
|
|
mv ui/dist/* $ui
|
2014-06-15 22:08:44 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = http://www.consul.io/;
|
|
|
|
description = "A tool for service discovery, monitoring and configuration";
|
2014-09-11 22:35:18 +00:00
|
|
|
maintainers = with maintainers; [ cstrahan wkennington ];
|
2014-06-15 22:08:44 +00:00
|
|
|
license = licenses.mpl20 ;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|