Replace telegraf with node exporter
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
51
packages/prometheus-podman-exporter/default.nix
Normal file
51
packages/prometheus-podman-exporter/default.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
{ pkgs, ... }:
|
||||
# AUTO-UPDATE: nix-update --flake prometheus-podman-exporter
|
||||
pkgs.buildGoModule rec {
|
||||
pname = "prometheus-podman-exporter";
|
||||
version = "1.15.0";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "containers";
|
||||
repo = "prometheus-podman-exporter";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-eXuLiJx0WsPlPAN5ZwQIp89thXiNS6AGE9p3aqjD+K8=";
|
||||
};
|
||||
|
||||
vendorHash = null;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
makeWrapper
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
btrfs-progs
|
||||
gpgme
|
||||
];
|
||||
|
||||
tags = [
|
||||
"containers_image_openpgp"
|
||||
"remote"
|
||||
];
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X github.com/containers/prometheus-podman-exporter/cmd.buildVersion=${version}"
|
||||
"-X github.com/containers/prometheus-podman-exporter/cmd.buildRevision=${builtins.head (pkgs.lib.strings.splitString "." version)}"
|
||||
"-X github.com/containers/prometheus-podman-exporter/cmd.buildBranch=HEAD"
|
||||
];
|
||||
|
||||
# Don't run tests because they require a running podman daemon
|
||||
doCheck = false;
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/prometheus-podman-exporter \
|
||||
--run '
|
||||
: "''${CONTAINER_HOST:=}"
|
||||
if [ -z "$CONTAINER_HOST" ]; then
|
||||
export CONTAINER_HOST=$([ "$UID" -eq 0 ] && echo "unix:///run/podman/podman.sock" || echo "unix://''${XDG_RUNTIME_DIR:-/run/user/$UID}/podman/podman.sock")
|
||||
fi
|
||||
'
|
||||
'';
|
||||
}
|
Reference in New Issue
Block a user