Files
nixpkgs/pkgs/development/python-modules/netbox-plugin-prometheus-sd/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01: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 = {
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 = lib.licenses.mit;
maintainers = with lib.maintainers; [ xanderio ];
};
}