diff --git a/nixos/modules/services/monitoring/prometheus/default.nix b/nixos/modules/services/monitoring/prometheus/default.nix index f516b75ab10f..c2b3fa2e4c4f 100644 --- a/nixos/modules/services/monitoring/prometheus/default.nix +++ b/nixos/modules/services/monitoring/prometheus/default.nix @@ -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; diff --git a/pkgs/servers/monitoring/prometheus/default.nix b/pkgs/servers/monitoring/prometheus/default.nix index f2c5d648c679..3701afc5139b 100644 --- a/pkgs/servers/monitoring/prometheus/default.nix +++ b/pkgs/servers/monitoring/prometheus/default.nix @@ -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; };