Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

56 lines
1.3 KiB
Nix

{
lib,
buildPythonPackage,
django,
fetchFromGitHub,
netaddr,
netbox,
poetry-core,
pythonOlder,
}:
buildPythonPackage rec {
pname = "netbox-plugin-prometheus-sd";
version = "1.2.0";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "FlxPeters";
repo = "netbox-plugin-prometheus-sd";
tag = "v${version}";
hash = "sha256-L5kJnaY9gKpsWAgwkjVRQQauL2qViinqk7rHLXTVzT4=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail 'version = "0.0.0"' 'version = "${version}"'
substituteInPlace netbox_prometheus_sd/__init__.py \
--replace-fail "from extras.plugins import PluginConfig" "from netbox.plugins import PluginConfig"
'';
build-system = [ poetry-core ];
dependencies = [
django
netaddr
];
nativeCheckInputs = [ netbox ];
preFixup = ''
export PYTHONPATH=${netbox}/opt/netbox/netbox:$PYTHONPATH
'';
pythonImportsCheck = [ "netbox_prometheus_sd" ];
meta = with lib; {
description = "Netbox plugin to provide Netbox entires to Prometheus HTTP service discovery";
homepage = "https://github.com/FlxPeters/netbox-plugin-prometheus-sd";
changelog = "https://github.com/FlxPeters/netbox-plugin-prometheus-sd/releases/tag/${src.tag}";
license = licenses.mit;
maintainers = with maintainers; [ xanderio ];
};
}