2022-04-03 18:54:34 +00:00
|
|
|
{ lib
|
|
|
|
, pkgs
|
|
|
|
, fetchFromGitHub
|
|
|
|
, nixosTests
|
|
|
|
, python3
|
|
|
|
|
|
|
|
, plugins ? ps: [] }:
|
|
|
|
|
|
|
|
let
|
|
|
|
py = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
2022-05-18 14:49:53 +00:00
|
|
|
django = super.django_4;
|
2022-04-03 18:54:34 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
extraBuildInputs = plugins py.pkgs;
|
|
|
|
in
|
|
|
|
py.pkgs.buildPythonApplication rec {
|
|
|
|
pname = "netbox";
|
2022-07-14 12:49:19 +00:00
|
|
|
version = "3.2.3";
|
2022-04-03 18:54:34 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "netbox-community";
|
|
|
|
repo = pname;
|
2022-07-14 12:49:19 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
sha256 = "sha256-mMTZKlGVjFPGJI4Ky+V3lPuMYS7tJb+zeDEzMeXdGoU=";
|
2022-04-03 18:54:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
format = "other";
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Allow setting the STATIC_ROOT from within the configuration and setting a custom redis URL
|
|
|
|
./config.patch
|
2022-04-27 09:35:20 +00:00
|
|
|
./graphql-3_2_0.patch
|
2022-04-03 18:54:34 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = with py.pkgs; [
|
2022-05-18 14:49:53 +00:00
|
|
|
django_4
|
2022-04-03 18:54:34 +00:00
|
|
|
django-cors-headers
|
|
|
|
django-debug-toolbar
|
|
|
|
django-filter
|
|
|
|
django-graphiql-debug-toolbar
|
|
|
|
django-mptt
|
|
|
|
django-pglocks
|
|
|
|
django-prometheus
|
|
|
|
django-redis
|
|
|
|
django-rq
|
|
|
|
django-tables2
|
|
|
|
django-taggit
|
|
|
|
django-timezone-field
|
|
|
|
djangorestframework
|
|
|
|
drf-yasg
|
2022-04-27 09:35:20 +00:00
|
|
|
swagger-spec-validator # from drf-yasg[validation]
|
2022-04-03 18:54:34 +00:00
|
|
|
graphene-django
|
|
|
|
jinja2
|
|
|
|
markdown
|
|
|
|
markdown-include
|
|
|
|
mkdocs-material
|
|
|
|
netaddr
|
|
|
|
pillow
|
|
|
|
psycopg2
|
|
|
|
pyyaml
|
|
|
|
social-auth-core
|
|
|
|
social-auth-app-django
|
|
|
|
svgwrite
|
|
|
|
tablib
|
|
|
|
jsonschema
|
|
|
|
] ++ extraBuildInputs;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/opt/netbox
|
|
|
|
cp -r . $out/opt/netbox
|
|
|
|
chmod +x $out/opt/netbox/netbox/manage.py
|
|
|
|
makeWrapper $out/opt/netbox/netbox/manage.py $out/bin/netbox \
|
|
|
|
--prefix PYTHONPATH : "$PYTHONPATH"
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
# PYTHONPATH of all dependencies used by the package
|
|
|
|
pythonPath = python3.pkgs.makePythonPath propagatedBuildInputs;
|
|
|
|
|
|
|
|
tests = {
|
|
|
|
inherit (nixosTests) netbox;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/netbox-community/netbox";
|
|
|
|
description = "IP address management (IPAM) and data center infrastructure management (DCIM) tool";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ n0emis raitobezarius ];
|
|
|
|
};
|
|
|
|
}
|