From 65cb93bdcbe304e452790406c65f8ff3b8ba6cc2 Mon Sep 17 00:00:00 2001 From: Alexander Sieg Date: Fri, 15 Nov 2024 20:31:52 +0200 Subject: [PATCH 1/2] python3Packages.netbox-plugin-prometheus-sd: init at 1.1.1 (cherry picked from commit d69c5a4ad3d5d45b6aa189b60f1d2d47dc4c04cb) --- .../netbox-plugin-prometheus-sd/default.nix | 41 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 43 insertions(+) create mode 100644 pkgs/development/python-modules/netbox-plugin-prometheus-sd/default.nix diff --git a/pkgs/development/python-modules/netbox-plugin-prometheus-sd/default.nix b/pkgs/development/python-modules/netbox-plugin-prometheus-sd/default.nix new file mode 100644 index 0000000000000..66115f810258e --- /dev/null +++ b/pkgs/development/python-modules/netbox-plugin-prometheus-sd/default.nix @@ -0,0 +1,41 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + poetry-core, + netbox, +}: + +buildPythonPackage rec { + pname = "netbox-plugin-prometheus-sd"; + version = "1.1.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "FlxPeters"; + repo = "netbox-plugin-prometheus-sd"; + rev = "v${version}"; + hash = lib.fakeHash; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + 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://pypi.org/project/netbox-plugin-prometheus-sd/"; + license = licenses.mit; + maintainers = with maintainers; [ xanderio ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 38d3f58638be9..91c283f732d67 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9015,6 +9015,8 @@ self: super: with self; { netbox-reorder-rack = callPackage ../development/python-modules/netbox-reorder-rack { }; + netbox-plugin-prometheus-sd = callPackage ../development/python-modules/netbox-plugin-prometheus-sd { }; + netcdf4 = callPackage ../development/python-modules/netcdf4 { }; netdata = callPackage ../development/python-modules/netdata { }; From 669cc837961ee16137aedcaeb4d58bb4a1d96675 Mon Sep 17 00:00:00 2001 From: Alexander Sieg Date: Mon, 2 Dec 2024 13:30:45 +0100 Subject: [PATCH 2/2] python3Packages.netbox-plugin-prometheus-sd: specify source hash (cherry picked from commit 187deac429b5c1f384ae00bd5619d44e6e194a40) --- .../python-modules/netbox-plugin-prometheus-sd/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/netbox-plugin-prometheus-sd/default.nix b/pkgs/development/python-modules/netbox-plugin-prometheus-sd/default.nix index 66115f810258e..24eb14c00748f 100644 --- a/pkgs/development/python-modules/netbox-plugin-prometheus-sd/default.nix +++ b/pkgs/development/python-modules/netbox-plugin-prometheus-sd/default.nix @@ -15,7 +15,7 @@ buildPythonPackage rec { owner = "FlxPeters"; repo = "netbox-plugin-prometheus-sd"; rev = "v${version}"; - hash = lib.fakeHash; + hash = "sha256-UtvSkqs2PN3uxCB78hJjh0lZ1WbZGjDpwlKyeAGpiEM="; }; nativeBuildInputs = [