prometheus: split doc and cli into extra outputs

This commit is contained in:
Sandro Jäckel 2023-03-10 11:45:45 +01:00
parent 2564ae1eed
commit da2f281453
No known key found for this signature in database
GPG Key ID: B1763F8651144063
2 changed files with 7 additions and 1 deletions

View File

@ -31,7 +31,7 @@ let
if checkConfigEnabled then
pkgs.runCommandLocal
"${name}-${replaceStrings [" "] [""] what}-checked"
{ buildInputs = [ cfg.package ]; } ''
{ buildInputs = [ cfg.package.cli ]; } ''
ln -s ${file} $out
promtool ${what} $out
'' else file;

View File

@ -41,6 +41,8 @@ buildGoModule rec {
pname = "prometheus";
inherit version;
outputs = [ "out" "doc" "cli" ];
src = fetchFromGitHub {
owner = "prometheus";
repo = "prometheus";
@ -132,6 +134,10 @@ buildGoModule rec {
cp -a $src/console_libraries $src/consoles $out/etc/prometheus
'';
postInstall = ''
moveToOutput bin/promtool $cli
'';
doCheck = !stdenv.isDarwin; # https://hydra.nixos.org/build/130673870/nixlog/1
passthru.tests = { inherit (nixosTests) prometheus; };