2024-12-12 14:41:43 +01:00
|
|
|
# SPDX-FileCopyrightText: 2024 Maurice Debray <maurice.debray@dgnum.eu>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: EUPL-1.2
|
|
|
|
|
2024-10-21 10:40:33 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
python3,
|
|
|
|
fetchgit,
|
|
|
|
ethtool,
|
|
|
|
dmidecode,
|
|
|
|
ipmitool,
|
|
|
|
lldpd,
|
|
|
|
lshw,
|
|
|
|
}:
|
|
|
|
|
|
|
|
python3.pkgs.buildPythonApplication {
|
|
|
|
pname = "netbox-agent";
|
|
|
|
version = "unstable-2023-03-19";
|
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://git.dgnum.eu/DGNum/netbox-agent";
|
2024-10-23 10:05:25 +02:00
|
|
|
rev = "424283239658516feb34c0f68496775350b1bf22";
|
|
|
|
hash = "sha256-sp1QVy8AIezR2LRDDYS9G0g0GQRwGKGmEE7ykITPxtY=";
|
2024-10-21 10:40:33 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = with python3.pkgs; [
|
|
|
|
setuptools
|
|
|
|
wheel
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonRelaxDeps = true;
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
distro
|
|
|
|
jsonargparse
|
|
|
|
netaddr
|
|
|
|
(callPackage ./netifaces2.nix { })
|
|
|
|
packaging
|
|
|
|
pynetbox
|
|
|
|
python-slugify
|
|
|
|
pyyaml
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/netbox_agent \
|
|
|
|
--prefix PATH ":" ${
|
|
|
|
lib.makeBinPath [
|
|
|
|
ethtool
|
|
|
|
dmidecode
|
|
|
|
ipmitool
|
|
|
|
lldpd
|
|
|
|
lshw
|
|
|
|
]
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "netbox_agent" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Netbox agent to run on your infrastructure's servers";
|
|
|
|
homepage = "https://git.dgnum.eu/DGNum/netbox-agent";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ ];
|
|
|
|
mainProgram = "netbox_agent";
|
|
|
|
};
|
|
|
|
}
|