nixpkgs/pkgs/servers/web-apps/peering-manager/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

93 lines
2.1 KiB
Nix
Raw Normal View History

2022-12-01 16:31:37 +00:00
{ python3
, fetchFromGitHub
, fetchpatch
, nixosTests
2023-07-12 16:30:55 +00:00
, lib
2022-12-01 16:31:37 +00:00
, plugins ? ps: []
}:
python3.pkgs.buildPythonApplication rec {
2022-12-01 16:31:37 +00:00
pname = "peering-manager";
2023-09-25 23:08:43 +00:00
version = "1.8.1";
2022-12-01 16:31:37 +00:00
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
2023-09-25 23:08:43 +00:00
sha256 = "sha256-N34piaSP+QKZzjT42nAR47DTtqGtZ/GMeTeTyRQw3/4=";
2022-12-01 16:31:37 +00:00
};
2023-09-25 23:08:43 +00:00
patches = [
# restore support unix sockets for redis connections
# https://github.com/peering-manager/peering-manager/pull/773
(fetchpatch {
url = "https://github.com/peering-manager/peering-manager/commit/ff66823c04d8c545a46dcec91d61eda7c21f99aa.patch";
hash = "sha256-x5E0LFhGrc5LPY4pwAMNUtigltLGqqbRCe1PIm0yLA8=";
})
];
2022-12-01 16:31:37 +00:00
format = "other";
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
] ++ 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
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";
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
}