mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 04:50:21 +00:00
58 lines
1.4 KiB
Nix
58 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
|
|
# build-system
|
|
poetry-core,
|
|
|
|
# dependencies
|
|
django,
|
|
netaddr,
|
|
netbox,
|
|
psycopg,
|
|
}:
|
|
|
|
buildPythonPackage (finalAttrs: {
|
|
pname = "netbox-plugin-prometheus-sd";
|
|
version = "1.3.0";
|
|
pyproject = true;
|
|
__structuredAttrs = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "FlxPeters";
|
|
repo = "netbox-plugin-prometheus-sd";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-2SVfWkw6/AkDihWp9chU8rTqLiSn9ax4uLaK1xydfGM=";
|
|
};
|
|
|
|
postPatch = ''
|
|
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
|
|
psycopg # not specified in pyproject.toml, but required at import time
|
|
];
|
|
|
|
nativeCheckInputs = [ netbox ];
|
|
|
|
preFixup = ''
|
|
export PYTHONPATH=${netbox}/opt/netbox/netbox:$PYTHONPATH
|
|
'';
|
|
|
|
pythonImportsCheck = [ "netbox_prometheus_sd" ];
|
|
|
|
meta = {
|
|
description = "Netbox plugin to provide Netbox entries 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/v${finalAttrs.version}";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ xanderio ];
|
|
};
|
|
})
|