1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-22 06:05:13 +00:00
nixpkgs/pkgs/servers/monitoring/uchiwa/default.nix

54 lines
1.3 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, buildBowerComponents, buildGoPackage, makeWrapper }:
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;
};
backend = buildGoPackage {
2019-08-13 22:52:01 +01:00
pname = "uchiwa-backend";
inherit version;
goPackagePath = "github.com/${owner}/${repo}";
inherit src;
postInstall = ''
mkdir -p $out
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;
inherit src;
nativeBuildInputs = [ makeWrapper ];
buildCommand = ''
mkdir -p $out/bin $out/public
makeWrapper ${backend}/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 lib; {
description = "A Dashboard for the sensu monitoring framework";
homepage = "http://sensuapp.org/";
license = licenses.mit;
maintainers = with maintainers; [ peterhoeg ];
platforms = platforms.unix;
};
}