2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, buildBowerComponents, buildGoPackage, makeWrapper }:
|
2017-02-24 14:51:17 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
inherit (import ./src.nix) version sha256;
|
|
|
|
owner = "sensu";
|
|
|
|
repo = "uchiwa";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit owner repo sha256;
|
2019-09-09 00:38:31 +01:00
|
|
|
rev = version;
|
2017-02-24 14:51:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
backend = buildGoPackage {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "uchiwa-backend";
|
|
|
|
inherit version;
|
2017-02-24 14:51:17 +00:00
|
|
|
goPackagePath = "github.com/${owner}/${repo}";
|
|
|
|
inherit src;
|
|
|
|
postInstall = ''
|
2020-04-28 02:50:57 +01:00
|
|
|
mkdir -p $out
|
2017-02-24 14:51:17 +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;
|
|
|
|
};
|
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
in stdenv.mkDerivation {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "uchiwa";
|
|
|
|
inherit version;
|
2017-02-24 14:51:17 +00:00
|
|
|
|
|
|
|
inherit src;
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2017-02-24 14:51:17 +00:00
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out/bin $out/public
|
2020-04-28 02:50:57 +01:00
|
|
|
makeWrapper ${backend}/bin/uchiwa $out/bin/uchiwa \
|
2017-02-24 14:51:17 +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-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-02-24 14:51:17 +00:00
|
|
|
description = "A Dashboard for the sensu monitoring framework";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://sensuapp.org/";
|
2017-02-24 14:51:17 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|