summary refs log tree commit diff
path: root/pkgs/servers/monitoring/bosun/default.nix
blob: a0b4a75f86391a48c1b27edfa1b70b39b70c8422 (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
{ stdenv, fetchgit, fetchurl, go }:
let
  go-fs = fetchgit {
    url = git://github.com/rakyll/statik.git;
    rev = "f19d7c21cd036701d42ec176b13e0946cc9591b0";
    sha256 = "0vaa8xzkmj1dgiayg7ccrniapz4f4rhsizx2hybyc5rgmalfj9ac";
  };

in stdenv.mkDerivation rec {
  name = "bosun-${version}";
  version = "20141119233013";
  src = fetchurl {
    url = "https://github.com/bosun-monitor/bosun/archive/${version}.tar.gz";
    sha256 = "0l16g073ixk42g3jz1r0lhmvssc0k8s1vnr9pvgxs897rzpdjjm1";
  };
  buildInputs = [ go ];

  sourceRoot = ".";

  buildPhase = ''
    mkdir -p src/github.com/bosun-monitor
    mv bosun-${version} src/github.com/bosun-monitor/bosun

    mkdir -p src/github.com/rakyll
    ln -s ${go-fs} src/github.com/rakyll/statik

    export GOPATH=$PWD
    go build -v -o bosun src/github.com/bosun-monitor/bosun/main.go
  '';

  installPhase = ''
    mkdir -p $out/bin
    cp bosun $out/bin
  '';

}