mob next [ci-skip] [ci skip] [skip ci]

lastFile:vars/per-machine/rigel/inventree/secret-key/secret
This commit is contained in:
2025-10-09 16:42:56 +07:00
parent 04fafa32d3
commit 1df60c35d9
33 changed files with 1445 additions and 2 deletions

145
pkgs/inventree/default.nix Normal file
View File

@@ -0,0 +1,145 @@
{
stdenvNoCC,
python3,
fetchFromGitHub,
fetchYarnDeps,
yarnConfigHook,
nodejs,
}:
let
version = "unstable-2025-05-09";
src = fetchFromGitHub {
owner = "inventree";
repo = "InvenTree";
rev = "e0acfaa762da0dd7b2822b567202210ca8b7dbd3";
hash = "sha256-K+cqErDUmgPO7625P3jp7+7BOYEfyJ1nElae6RlJvvI=";
};
frontend = stdenvNoCC.mkDerivation {
name = "inventree-frontend";
inherit version src;
yarnOfflineCache = fetchYarnDeps {
yarnLock = "${src}/src/frontend/yarn.lock";
hash = "sha256-KpWuYCrkGN+4UnwV1STEbTL0FWcLZ7Wq8a8ST55OpGM=";
};
nativeBuildInputs = [
yarnConfigHook
nodejs
];
patchPhase = ''
runHook prePatch
cd src/frontend
runHook postPatch
'';
buildPhase = ''
echo "Running lingui"
./node_modules/.bin/lingui compile --typescript
echo building lib
./node_modules/.bin/tsc --p ./tsconfig.lib.json
./node_modules/.bin/vite --config vite.lib.config.ts build
echo "Running tsc"
./node_modules/.bin/tsc
echo "Running vite"
./node_modules/.bin/vite build --emptyOutDir --outDir $out
'';
};
in
python3.pkgs.buildPythonApplication rec {
pname = "InvenTree";
inherit version src;
format = "other";
dependencies = with python3.pkgs; [
coreapi
cryptography
distutils
dj-rest-auth
django_4
django-allauth
django-allauth.optional-dependencies.openid
django-allauth.optional-dependencies.mfa
django-allauth.optional-dependencies.socialaccount
django-cleanup
django-cors-headers
django-dbbackup
django-error-report-2
django-filter
django-flags
django-formtools
django-ical
django-js-asset
django-maintenance-mode
django-markdownify
django-money
django-mptt
django-redis
django-oauth-toolkit
django-otp
django-q-sentry
django-q2
django-redis
django-sesame
django-sql-utils
django-structlog
django-stdimage
django-taggit
django-user-sessions
django-weasyprint
djangorestframework
djangorestframework-simplejwt
djangorestframework-simplejwt.optional-dependencies.crypto
django-xforwardedfor-middleware
drf-spectacular
dulwich
feedparser
gunicorn
pdf2image
pillow
pint
pip-licenses
pypdf
python-barcode
python-barcode.optional-dependencies.images
python-dotenv
pyyaml
qrcode
qrcode.optional-dependencies.pil
rapidfuzz
sentry-sdk
tablib
tablib.optional-dependencies.xls
tablib.optional-dependencies.xlsx
tablib.optional-dependencies.yaml
weasyprint
whitenoise
psycopg2
fido2
];
nativeCheckInputs = with python3.pkgs; [ django-slowtests ];
installPhase = ''
mkdir -p $out/opt/inventree
cp -r . $out/opt/inventree
echo "Installing frontend"
mkdir -p $out/opt/inventree/src/backend/InvenTree/web/static/web
cp -r ${frontend}/* $out/opt/inventree/src/backend/InvenTree/web/static/web/
cp -r ${frontend}/.* $out/opt/inventree/src/backend/InvenTree/web/static/web/
'';
passthru = {
pythonPath = python3.pkgs.makePythonPath dependencies;
gunicorn = python3.pkgs.gunicorn;
inherit frontend;
};
}

27
pkgs/overlay.nix Normal file
View File

@@ -0,0 +1,27 @@
inputs: final: prev: {
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
(py-final: py-prev: {
django-dbbackup = py-final.callPackage ./python/django-dbbackup { };
django-error-report-2 = py-final.callPackage ./python/django-error-report-2 { };
django-flags = py-final.callPackage ./python/django-flags { };
django-ical = py-final.callPackage ./python/django-ical { };
django-markdownify = py-final.callPackage ./python/django-markdownify { };
django-money = py-final.callPackage ./python/django-money { };
django-q-sentry = py-final.callPackage ./python/django-q-sentry { };
django-recurrence = py-final.callPackage ./python/django-recurrence { };
django-slowtests = py-final.callPackage ./python/django-slowtests { };
django-structlog = py-final.callPackage ./python/django-structlog { };
django-stdimage = py-final.callPackage ./python/django-stdimage { };
django-user-sessions = py-final.callPackage ./python/django-user-sessions { };
django-weasyprint = py-final.callPackage ./python/django-weasyprint { };
django-xforwardedfor-middleware = py-final.callPackage ./python/django-xforwardedfor-middleware { };
pip-licenses = py-final.callPackage ./python/pip-licenses { };
py-moneyed = py-final.callPackage ./python/py-moneyed { };
pytest-pycodestyle = py-final.callPackage ./python/pytest-codestyle { };
sentry-sdk = py-final.callPackage ./python/sentry-sdk { };
})
];
inventree = final.callPackage ./inventree { python3 = final.python312; };
}

View File

@@ -0,0 +1,42 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
wheel,
django_4,
pytz,
}:
buildPythonPackage rec {
pname = "django-dbbackup";
version = "4.2.1";
pyproject = true;
src = fetchFromGitHub {
owner = "jazzband";
repo = "django-dbbackup";
rev = version;
hash = "sha256-GD+f9mbImGPQ6MOUK3ftHqiGv7TT39jNQsFvd0dnnWU=";
};
build-system = [
setuptools
wheel
];
dependencies = [
django_4
pytz
];
pythonImportsCheck = [ "dbbackup" ];
meta = {
description = "Management commands to help backup and restore your project database and media files";
homepage = "https://github.com/jazzband/django-dbbackup";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ ];
mainProgram = "django-dbbackup";
};
}

View File

@@ -0,0 +1,37 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
wheel,
django,
}:
buildPythonPackage rec {
pname = "django-error-report-2";
version = "0.4.2";
pyproject = true;
src = fetchFromGitHub {
owner = "matmair";
repo = "django-error-report-2";
rev = version;
hash = "sha256-ZCaslqgruJxM8345/jSlZGruM+27H9hvwL0wtPkUzc0=";
};
build-system = [
setuptools
wheel
];
dependencies = [ django ];
pythonImportsCheck = [ "error_report" ];
meta = {
description = "Log/View Django server errors";
homepage = "https://github.com/matmair/django-error-report-2";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ];
};
}

View File

@@ -0,0 +1,37 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
wheel,
django,
}:
buildPythonPackage rec {
pname = "django-flags";
version = "5.0.13";
pyproject = true;
src = fetchFromGitHub {
owner = "cfpb";
repo = "django-flags";
rev = version;
hash = "sha256-WPMfFYoP6WaVzZmVtqAz4LlY761aCRyPhd5npc8bOOI=";
};
build-system = [
setuptools
wheel
];
dependencies = [ django ];
pythonImportsCheck = [ "flags" ];
meta = {
description = "Feature flags for Django projects";
homepage = "https://github.com/cfpb/django-flags";
license = lib.licenses.cc0;
maintainers = with lib.maintainers; [ ];
};
}

View File

@@ -0,0 +1,46 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
setuptools-scm,
wheel,
django,
django-recurrence,
icalendar,
}:
buildPythonPackage rec {
pname = "django-ical";
version = "1.9.2";
pyproject = true;
src = fetchFromGitHub {
owner = "jazzband";
repo = "django-ical";
rev = version;
hash = "sha256-DUe0loayGcUS7MTyLn+g0KBxbIY7VsaoQNHGSMbMI3U=";
};
build-system = [
setuptools
setuptools-scm
wheel
];
dependencies = [
django
django-recurrence
icalendar
];
pythonImportsCheck = [ "django_ical" ];
meta = {
description = "ICal feeds for Django based on Django's syndication feed framework";
homepage = "https://github.com/jazzband/django-ical";
changelog = "https://github.com/jazzband/django-ical/blob/${src.rev}/CHANGES.rst";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ];
};
}

View File

@@ -0,0 +1,39 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
bleach,
django,
markdown,
}:
buildPythonPackage rec {
pname = "django-markdownify";
version = "0.9.5";
pyproject = true;
src = fetchFromGitHub {
owner = "erwinmatijsen";
repo = "django-markdownify";
rev = version;
hash = "sha256-KYU8p8NRD4EIS/KhOk9nvmXCf0RWEc+IFZ57YtsDSWE=";
};
build-system = [ setuptools ];
dependencies = [
bleach
django
markdown
];
pythonImportsCheck = [ "markdownify" ];
meta = {
description = "Markdown template filter for Django";
homepage = "https://github.com/erwinmatijsen/django-markdownify";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ];
};
}

View File

@@ -0,0 +1,41 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
wheel,
django,
py-moneyed,
}:
buildPythonPackage rec {
pname = "django-money";
version = "3.2";
pyproject = true;
src = fetchFromGitHub {
owner = "django-money";
repo = "django-money";
rev = version;
hash = "sha256-eL26NsreUqtMJ26TmvmB53EJI4Sjs7qjFDnnt4N0vdI=";
};
build-system = [
setuptools
wheel
];
dependencies = [
django
py-moneyed
];
pythonImportsCheck = [ "djmoney" ];
meta = {
description = "Money fields for Django forms and models";
homepage = "https://github.com/django-money/django-money";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ ];
};
}

View File

@@ -0,0 +1,37 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
poetry-core,
setuptools,
sentry-sdk,
}:
buildPythonPackage rec {
pname = "django-q-sentry";
version = "0.1.6";
pyproject = true;
src = fetchFromGitHub {
owner = "danielwelch";
repo = "django-q-sentry";
rev = "d3a43a90c82734244d5ebf3295652223053f1354";
hash = "sha256-3C7A+X18c7p19HWD/uPRtAMf29VjmrfXXh2z5PPOREY=";
};
build-system = [
poetry-core
setuptools
];
dependencies = [ sentry-sdk ];
pythonImportsCheck = [ "django_q_sentry" ];
meta = {
description = "Bringing Sentry error tracking to Django Q";
homepage = "https://github.com/danielwelch/django-q-sentry";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ];
};
}

View File

@@ -0,0 +1,56 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
pdm-backend,
django,
flake8,
pytest,
pytest-cov,
pytest-django,
pytest-sugar,
python-dateutil,
sphinx,
sphinx-rtd-theme,
tox,
}:
buildPythonPackage rec {
pname = "django-recurrence";
version = "1.12.1";
pyproject = true;
src = fetchFromGitHub {
owner = "jazzband";
repo = "django-recurrence";
rev = version;
hash = "sha256-Q33zyMa1wI13RNLxynGAJHlagahpnFHCmZbHp0aPC/w=";
};
build-system = [ pdm-backend ];
dependencies = [
django
flake8
pytest
pytest-cov
pytest-django
pytest-sugar
python-dateutil
sphinx
sphinx-rtd-theme
tox
];
pythonRelaxDeps = true;
pythonImportsCheck = [ "recurrence" ];
meta = {
description = "Utility for working with recurring dates in Django";
homepage = "https://github.com/django-recurrence/django-recurrence";
changelog = "https://github.com/django-recurrence/django-recurrence/blob/${src.rev}/CHANGES.rst";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ ];
};
}

View File

@@ -0,0 +1,38 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
wheel,
django_4,
}:
buildPythonPackage rec {
pname = "django-slowtests";
version = "1.1.1";
pyproject = true;
src = fetchFromGitHub {
owner = "realpython";
repo = "django-slow-tests";
rev = version;
hash = "sha256-gW9AZiMpXJp1m2X1cbm6GdZ9cH+TFqjNLQJFmsvGjB0=";
};
build-system = [
setuptools
wheel
];
dependencies = [ django_4 ];
pythonImportsCheck = [ "django_slowtests" ];
meta = {
description = "Locate your slowest tests";
homepage = "https://github.com/realpython/django-slow-tests";
changelog = "https://github.com/realpython/django-slow-tests/blob/${src.rev}/CHANGELOG.rst";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ];
};
}

View File

@@ -0,0 +1,51 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
setuptools-scm,
wheel,
django,
pillow,
gettext,
}:
buildPythonPackage rec {
pname = "django-stdimage";
version = "6.0.2";
pyproject = true;
src = fetchFromGitHub {
owner = "codingjoe";
repo = "django-stdimage";
rev = version;
hash = "sha256-uwVU3Huc5fitAweShJjcMW//GBeIpJcxqKKLGo/EdIs=";
};
build-system = [
setuptools
setuptools-scm
wheel
];
dependencies = [
django
pillow
];
nativeBuildInputs = [ gettext ];
preBuild = ''
echo "bla bla"
echo $PATH
'';
pythonImportsCheck = [ "stdimage" ];
meta = {
description = "";
homepage = "https://github.com/codingjoe/django-stdimage";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ];
};
}

View File

@@ -0,0 +1,48 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
asgiref,
django,
django-ipware,
structlog,
celery,
django-extensions,
}:
buildPythonPackage rec {
pname = "django-structlog";
version = "9.1.1";
pyproject = true;
src = fetchFromGitHub {
owner = "jrobichaud";
repo = "django-structlog";
rev = version;
hash = "sha256-SEigOdlXZtfLAgRgGkv/eDNDAiiHd7YthRJ/H6e1v5U=";
};
build-system = [ setuptools ];
dependencies = [
asgiref
django
django-ipware
structlog
];
optional-dependencies = {
celery = [ celery ];
commands = [ django-extensions ];
};
pythonImportsCheck = [ "django_structlog" ];
meta = {
description = "";
homepage = "https://github.com/jrobichaud/django-structlog";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ];
};
}

View File

@@ -0,0 +1,39 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
setuptools-scm,
wheel,
django,
}:
buildPythonPackage rec {
pname = "django-user-sessions";
version = "2.0.0";
pyproject = true;
src = fetchFromGitHub {
owner = "jazzband";
repo = "django-user-sessions";
rev = version;
hash = "sha256-Wexy6G2pZ8LTnqtJkBZIePV7qhQW8gu/mKiQfZtgf/o=";
};
build-system = [
setuptools
setuptools-scm
wheel
];
dependencies = [ django ];
pythonImportsCheck = [ "user_sessions" ];
meta = {
description = "Extend Django sessions with a foreign key back to the user, allowing enumerating all user's sessions";
homepage = "http://github.com/jazzband/django-user-sessions";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ];
};
}

View File

@@ -0,0 +1,38 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
django,
weasyprint,
}:
buildPythonPackage rec {
pname = "django-weasyprint";
version = "2.4.0";
pyproject = true;
src = fetchFromGitHub {
owner = "fdemmer";
repo = "django-weasyprint";
rev = "v${version}";
hash = "sha256-eSh1p+5MyYb6GIEgSdlFxPzVCenlkwSCTkTzgKjezIg=";
};
build-system = [ setuptools ];
dependencies = [
django
weasyprint
];
pythonImportsCheck = [ "django_weasyprint" ];
meta = {
description = "A Django class-based view generating PDF resposes using WeasyPrint";
homepage = "https://github.com/fdemmer/django-weasyprint";
changelog = "https://github.com/fdemmer/django-weasyprint/blob/${src.rev}/CHANGELOG.md";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ ];
};
}

View File

@@ -0,0 +1,37 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
wheel,
django,
}:
buildPythonPackage rec {
pname = "django-xforwardedfor-middleware";
version = "2.0";
pyproject = true;
src = fetchFromGitHub {
owner = "allo-";
repo = "django-xforwardedfor-middleware";
rev = "v${version}";
hash = "sha256-dDXSb17kXOSeIgY6wid1QFHhUjrapasWgCEb/El51eA=";
};
build-system = [
setuptools
wheel
];
dependencies = [ django ];
pythonImportsCheck = [ "x_forwarded_for" ];
meta = {
description = "Use the X-Forwarded-For header to get the real ip of a request";
homepage = "https://github.com/allo-/django-xforwardedfor-middleware";
license = lib.licenses.publicDomain;
maintainers = with lib.maintainers; [ ];
};
}

View File

@@ -0,0 +1,74 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
setuptools-scm,
wheel,
prettytable,
tomli,
autopep8,
black,
docutils,
isort,
mypy,
pip-tools,
pypandoc,
pytest-cov,
pytest-pycodestyle,
pytest-runner,
tomli-w,
twine,
}:
buildPythonPackage rec {
pname = "pip-licenses";
version = "5.0.0";
pyproject = true;
src = fetchFromGitHub {
owner = "raimon49";
repo = "pip-licenses";
rev = "v-${version}";
hash = "sha256-6xw6BCuXSzNcwkpHaEFC5UPpubPUwhx/pg6vZq2er7A=";
};
build-system = [
setuptools
setuptools-scm
wheel
];
dependencies = [
prettytable
tomli
];
optional-dependencies = {
dev = [
autopep8
black
docutils
isort
mypy
pip-tools
pypandoc
pytest-cov
pytest-pycodestyle
pytest-runner
tomli-w
twine
wheel
];
};
pythonImportsCheck = [ "piplicenses" ];
meta = {
description = "Dump the license list of packages installed with pip";
homepage = "https://github.com/raimon49/pip-licenses";
changelog = "https://github.com/raimon49/pip-licenses/blob/${src.rev}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ];
};
}

View File

@@ -0,0 +1,42 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
wheel,
babel,
typing-extensions,
}:
buildPythonPackage rec {
pname = "py-moneyed";
version = "3.0";
pyproject = true;
src = fetchFromGitHub {
owner = "py-moneyed";
repo = "py-moneyed";
rev = "v${version}";
hash = "sha256-k0ZbLwog6TYxKDLZV7eH1Br8buMPfpOkgp+pMN/qdB8=";
};
build-system = [
setuptools
wheel
];
dependencies = [
babel
typing-extensions
];
pythonImportsCheck = [ "moneyed" ];
meta = {
description = "Provides Currency and Money classes for use in your Python code";
homepage = "http://github.com/py-moneyed/py-moneyed";
changelog = "https://github.com/py-moneyed/py-moneyed/blob/${src.rev}/CHANGES.rst";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ ];
};
}

View File

@@ -0,0 +1,43 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
wheel,
certifi,
urllib3,
}:
buildPythonPackage rec {
pname = "sentry-sdk";
version = "2.26.1";
pyproject = true;
src = fetchFromGitHub {
owner = "getsentry";
repo = "sentry-python";
rev = version;
hash = "sha256-Wl8yq2X9GuPcqaS93hkKXs2cDzz282Xceaai4NjbVZY=";
fetchSubmodules = true;
};
build-system = [
setuptools
wheel
];
dependencies = [
certifi
urllib3
];
pythonImportsCheck = [ "sentry_sdk" ];
meta = {
description = "The official Python SDK for Sentry.io";
homepage = "https://github.com/getsentry/sentry-python";
changelog = "https://github.com/getsentry/sentry-python/blob/${src.rev}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ];
};
}