diff options
author | William A. Kennington III <william@wkennington.com> | 2015-05-18 15:38:27 -0700 |
---|---|---|
committer | William A. Kennington III <william@wkennington.com> | 2015-05-18 19:45:19 -0700 |
commit | 414b3f2909a0a912cb7fb4a5890b7cd31867d8f1 (patch) | |
tree | 3258acfb3873c9b135c59b74721abbd3bf628ab7 /pkgs/servers/consul | |
parent | 1dbd67ee820159c3829f04b2aba66451c43109e9 (diff) |
consul: Move into the go-packages framework
Diffstat (limited to 'pkgs/servers/consul')
-rw-r--r-- | pkgs/servers/consul/default.nix | 63 | ||||
-rw-r--r-- | pkgs/servers/consul/ui.nix | 39 |
2 files changed, 39 insertions, 63 deletions
diff --git a/pkgs/servers/consul/default.nix b/pkgs/servers/consul/default.nix deleted file mode 100644 index b299981bee2a..000000000000 --- a/pkgs/servers/consul/default.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ stdenv, lib, go, fetchgit, fetchhg, fetchbzr, fetchFromGitHub , ruby , nodejs -, bundlerEnv }: - -let - version = "0.5.0"; - # `sass` et al - gems = bundlerEnv { - name = "consul-deps"; - gemfile = ./Gemfile; - lockfile = ./Gemfile.lock; - 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 gems 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 = '' - # Fix references to go-deps in the binary - hash=$(echo $src | sed 's,.*/\([^/-]*\).*,\1,g') - xs=$(printf 'x%.0s' $(seq 2 $(echo $hash | wc -c))) - sed -i "s,$hash,$xs,g" consul - - # 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; - }; -} diff --git a/pkgs/servers/consul/ui.nix b/pkgs/servers/consul/ui.nix new file mode 100644 index 000000000000..eb7093ec615d --- /dev/null +++ b/pkgs/servers/consul/ui.nix @@ -0,0 +1,39 @@ +{ stdenv, goPackages, ruby , nodejs, bundlerEnv }: + +let + # `sass` et al + gems = bundlerEnv { + name = "consul-ui-deps"; + gemfile = ./Gemfile; + lockfile = ./Gemfile.lock; + gemset = ./gemset.nix; + }; +in + +stdenv.mkDerivation { + name = "consul-ui-${goPackages.consul.rev}"; + + src = goPackages.consul.src; + + buildInputs = [ ruby gems nodejs ]; + + buildPhase = '' + # Build ui static files + cd ui + make dist + ''; + + installPhase = '' + # Install ui static files + mkdir -p $out + mv dist/* $out + ''; + + meta = with stdenv.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; + }; +} |