2025-03-15 10:58:03 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
2025-06-23 22:53:15 +02:00
|
|
|
python,
|
2025-03-15 10:58:03 +01:00
|
|
|
fetchFromGitHub,
|
|
|
|
setuptools,
|
|
|
|
python-dateutil,
|
|
|
|
drf-yasg,
|
|
|
|
netbox,
|
2025-06-24 05:13:07 +08:00
|
|
|
netaddr,
|
2025-03-15 10:58:03 +01:00
|
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "netbox-contract";
|
2025-06-23 23:01:12 +02:00
|
|
|
version = "2.4.0";
|
2025-03-15 10:58:03 +01:00
|
|
|
pyproject = true;
|
|
|
|
|
2025-06-23 22:53:15 +02:00
|
|
|
disabled = python.pythonVersion != netbox.python.pythonVersion;
|
2025-03-15 10:58:03 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mlebreuil";
|
|
|
|
repo = "netbox-contract";
|
|
|
|
tag = "v${version}";
|
2025-06-23 23:01:12 +02:00
|
|
|
hash = "sha256-duA53cuJ3q6CRp239xNMXQhGZHGn7IBIGNLoxt7hZh8=";
|
2025-03-15 10:58:03 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
python-dateutil
|
|
|
|
drf-yasg
|
|
|
|
];
|
|
|
|
|
|
|
|
# running tests requires initialized django project
|
|
|
|
nativeCheckInputs = [
|
|
|
|
netbox
|
2025-06-24 05:13:07 +08:00
|
|
|
netaddr
|
2025-03-15 10:58:03 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
export PYTHONPATH=${netbox}/opt/netbox/netbox:$PYTHONPATH
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "netbox_contract" ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Contract plugin for netbox";
|
|
|
|
homepage = "https://github.com/mlebreuil/netbox-contract";
|
2025-06-02 15:33:21 +02:00
|
|
|
changelog = "https://github.com/mlebreuil/netbox-contract/releases/tag/${src.rev}";
|
2025-03-15 10:58:03 +01:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
maintainers = with lib.maintainers; [ felbinger ];
|
|
|
|
};
|
|
|
|
}
|