2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, buildBowerComponents, buildGoPackage, makeWrapper }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
inherit (import ./src.nix) version sha256;
|
|
|
|
owner = "sensu";
|
|
|
|
repo = "uchiwa";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit owner repo sha256;
|
|
|
|
rev = version;
|
|
|
|
};
|
|
|
|
|
|
|
|
backend = buildGoPackage {
|
|
|
|
pname = "uchiwa-backend";
|
|
|
|
inherit version;
|
|
|
|
goPackagePath = "github.com/${owner}/${repo}";
|
|
|
|
inherit src;
|
|
|
|
postInstall = ''
|
2020-05-15 21:57:56 +00:00
|
|
|
mkdir -p $out
|
2020-04-24 23:36:52 +00:00
|
|
|
cp go/src/github.com/sensu/uchiwa/public/index.html $out/
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
frontend = buildBowerComponents {
|
|
|
|
name = "uchiwa-frontend-${version}";
|
|
|
|
generated = ./bower-packages.nix;
|
|
|
|
inherit src;
|
|
|
|
};
|
|
|
|
|
|
|
|
in stdenv.mkDerivation {
|
|
|
|
pname = "uchiwa";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
inherit src;
|
|
|
|
|
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out/bin $out/public
|
2020-05-15 21:57:56 +00:00
|
|
|
makeWrapper ${backend}/bin/uchiwa $out/bin/uchiwa \
|
2020-04-24 23:36:52 +00:00
|
|
|
--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
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A Dashboard for the sensu monitoring framework";
|
|
|
|
homepage = "http://sensuapp.org/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|