2022-12-01 16:31:37 +00:00
|
|
|
{ python3
|
|
|
|
, fetchFromGitHub
|
|
|
|
, nixosTests
|
2023-07-12 16:30:55 +00:00
|
|
|
, lib
|
2022-12-01 16:31:37 +00:00
|
|
|
|
|
|
|
, plugins ? ps: []
|
|
|
|
}:
|
|
|
|
|
2023-09-25 21:11:05 +00:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2022-12-01 16:31:37 +00:00
|
|
|
pname = "peering-manager";
|
2024-02-05 01:18:33 +00:00
|
|
|
version = "1.8.3";
|
2022-12-01 16:31:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
2024-02-05 01:18:33 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
sha256 = "sha256-UV1zSX9C9y5faOBUQ7bfj2DT6ffhMW28MIT7SaYjMgw=";
|
2022-12-01 16:31:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
format = "other";
|
|
|
|
|
2024-09-06 18:30:16 +00:00
|
|
|
patches = [
|
|
|
|
# Fix compatibility with pyixapi 0.2.3
|
|
|
|
# https://github.com/peering-manager/peering-manager/commit/ee558ff66e467412942559a8a92252e3fc009920
|
|
|
|
./fix-pyixapi-0.2.3-compatibility.patch
|
|
|
|
];
|
|
|
|
|
2023-09-25 21:11:05 +00:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
2022-12-01 16:31:37 +00:00
|
|
|
django
|
|
|
|
djangorestframework
|
2023-09-25 23:08:43 +00:00
|
|
|
django-redis
|
2022-12-01 16:31:37 +00:00
|
|
|
django-debug-toolbar
|
|
|
|
django-filter
|
|
|
|
django-postgresql-netfields
|
|
|
|
django-prometheus
|
|
|
|
django-rq
|
|
|
|
django-tables2
|
|
|
|
django-taggit
|
|
|
|
drf-spectacular
|
2023-09-25 23:08:43 +00:00
|
|
|
drf-spectacular-sidecar
|
2022-12-01 16:31:37 +00:00
|
|
|
jinja2
|
|
|
|
markdown
|
|
|
|
napalm
|
|
|
|
packaging
|
|
|
|
psycopg2
|
2023-09-25 23:08:43 +00:00
|
|
|
pyixapi
|
2022-12-01 16:31:37 +00:00
|
|
|
pynetbox
|
|
|
|
pyyaml
|
|
|
|
requests
|
|
|
|
tzdata
|
2023-09-25 21:11:05 +00:00
|
|
|
] ++ plugins python3.pkgs;
|
2022-12-01 16:31:37 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
cp peering_manager/configuration{.example,}.py
|
|
|
|
python3 manage.py collectstatic --no-input
|
|
|
|
rm -f peering_manager/configuration.py
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/opt/peering-manager
|
|
|
|
cp -r . $out/opt/peering-manager
|
|
|
|
chmod +x $out/opt/peering-manager/manage.py
|
|
|
|
makeWrapper $out/opt/peering-manager/manage.py $out/bin/peering-manager \
|
|
|
|
--prefix PYTHONPATH : "$PYTHONPATH"
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
# PYTHONPATH of all dependencies used by the package
|
2023-09-25 21:11:05 +00:00
|
|
|
python = python3;
|
|
|
|
pythonPath = python3.pkgs.makePythonPath propagatedBuildInputs;
|
2022-12-01 16:31:37 +00:00
|
|
|
|
|
|
|
tests = {
|
|
|
|
inherit (nixosTests) peering-manager;
|
|
|
|
};
|
|
|
|
};
|
2023-07-12 16:30:55 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://peering-manager.net/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
description = "BGP sessions management tool";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "peering-manager";
|
2023-09-12 13:18:06 +00:00
|
|
|
maintainers = teams.wdz.members;
|
2023-07-12 16:30:55 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
2022-12-01 16:31:37 +00:00
|
|
|
}
|