From 0035b239c9dc49b797b7015a237f69df2188e064 Mon Sep 17 00:00:00 2001 From: Nico Felbinger Date: Thu, 16 Jan 2025 19:34:44 +0100 Subject: [PATCH] python312Packages.netbox-diode-plugin: init at 0.6.0 --- .../netbox-diode-plugin/default.nix | 49 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 51 insertions(+) create mode 100644 pkgs/development/python-modules/netbox-diode-plugin/default.nix diff --git a/pkgs/development/python-modules/netbox-diode-plugin/default.nix b/pkgs/development/python-modules/netbox-diode-plugin/default.nix new file mode 100644 index 00000000000000..f2e8f730e61247 --- /dev/null +++ b/pkgs/development/python-modules/netbox-diode-plugin/default.nix @@ -0,0 +1,49 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + netbox, + brotli, + certifi, + grpcio, + protobuf, +}: +buildPythonPackage rec { + pname = "netbox-diode-plugin"; + version = "0.6.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "netboxlabs"; + repo = "diode-netbox-plugin"; + rev = "v${version}"; + hash = "sha256-VamAjgPUwU2N69r4cFZkg3f6bY4LMXk/4IE85/27n/U="; + }; + + build-system = [ setuptools ]; + + nativeCheckInputs = [ netbox ]; + + dependencies = [ + brotli + certifi + grpcio + protobuf + ]; + + postPatch = '' + sed -i 's/certifi==[0-9\.]*/certifi/; s/grpcio==[0-9\.]*/grpcio/; s/protobuf==[0-9\.]*/protobuf/' pyproject.toml + ''; + + pythonImportsCheck = [ "netbox_diode_plugin" ]; + + meta = { + description = "Official NetBox Labs plugin for NetBox for Diode"; + homepage = "https://github.com/netboxlabs/diode-netbox-plugin"; + changelog = "https://github.com/netboxlabs/diode-netbox-plugin/releases/tag/${src.rev}"; + license = lib.licenses.polyFormShield; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ felbinger ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c0b4b6e5bfd4f7..cb9f831e29f905 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9156,6 +9156,8 @@ self: super: with self; { netbox-bgp = callPackage ../development/python-modules/netbox-bgp { }; + netbox-diode-plugin = callPackage ../development/python-modules/netbox-diode-plugin { }; + netbox-documents = callPackage ../development/python-modules/netbox-documents { }; netbox-plugin-prometheus-sd = callPackage ../development/python-modules/netbox-plugin-prometheus-sd { };