3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/servers/consul/default.nix
Charles Strahan 94dd4b9721 ruby: WIP
2014-12-30 21:05:00 -05:00

53 lines
1.1 KiB
Nix

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