2017-02-24 15:51:17 +01:00
|
|
|
{ stdenv, fetchFromGitHub, buildBowerComponents, buildGoPackage, makeWrapper }:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (import ./src.nix) version sha256;
|
|
|
|
owner = "sensu";
|
|
|
|
repo = "uchiwa";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit owner repo sha256;
|
|
|
|
rev = "${version}";
|
|
|
|
};
|
|
|
|
|
|
|
|
backend = buildGoPackage {
|
2019-08-13 23:52:01 +02:00
|
|
|
pname = "uchiwa-backend";
|
|
|
|
inherit version;
|
2017-02-24 15:51:17 +01:00
|
|
|
goPackagePath = "github.com/${owner}/${repo}";
|
|
|
|
inherit src;
|
|
|
|
postInstall = ''
|
2018-08-09 20:39:59 +02:00
|
|
|
mkdir $out
|
2017-02-24 15:51:17 +01:00
|
|
|
cp go/src/github.com/sensu/uchiwa/public/index.html $out/
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
frontend = buildBowerComponents {
|
|
|
|
name = "uchiwa-frontend-${version}";
|
|
|
|
generated = ./bower-packages.nix;
|
|
|
|
inherit src;
|
|
|
|
};
|
|
|
|
|
2019-08-13 23:52:01 +02:00
|
|
|
in stdenv.mkDerivation {
|
2019-08-13 23:52:01 +02:00
|
|
|
pname = "uchiwa";
|
|
|
|
inherit version;
|
2017-02-24 15:51:17 +01:00
|
|
|
|
|
|
|
inherit src;
|
|
|
|
|
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out/bin $out/public
|
|
|
|
makeWrapper ${backend.bin}/bin/uchiwa $out/bin/uchiwa \
|
|
|
|
--add-flags "-p $out/public"
|
|
|
|
ln -s ${backend.out}/index.html $out/public/index.html
|
|
|
|
ln -s ${frontend.out}/bower_components $out/public/bower_components
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A Dashboard for the sensu monitoring framework";
|
|
|
|
homepage = http://sensuapp.org/;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|