summary refs log tree commit diff
path: root/pkgs/servers/consul/ui.nix
blob: da9b518bad7344bfc3f5702e0861c2f5e6f16cc0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ stdenv, consul, ruby, bundlerEnv, zip, nodejs }:

let
  # `sass` et al
  gems = bundlerEnv {
    name = "consul-ui-deps";
    gemdir = ./.;
  };
in

stdenv.mkDerivation {
  name = "consul-ui-${consul.version}";

  src = consul.src;

  buildInputs = [ ruby gems zip nodejs ];

  patches = [ ./ui-no-bundle-exec.patch ];

  postPatch = "patchShebangs ./ui/scripts/dist.sh";

  buildPhase = ''
    # Build ui static files
    cd ui
    make dist
  '';

  installPhase = ''
    # Install ui static files
    mkdir -p $out
    mv ../pkg/web_ui/* $out
  '';

  meta = with stdenv.lib; {
    homepage    = https://www.consul.io/;
    description = "A tool for service discovery, monitoring and configuration";
    maintainers = with maintainers; [ cstrahan wkennington ];
    license     = licenses.mpl20 ;
    platforms   = platforms.unix;
  };
}