nix/pkgs/indico/default.nix
Jeltz d12f9d91d1
WIP: Add indico profile + required packages
Signed-off-by: Jeltz <jeltz@federez.net>
2025-04-05 21:19:32 +02:00

174 lines
4.2 KiB
Nix

{
lib,
fetchFromGitHub,
fetchPypi,
python3,
}:
let
python = python3.override {
self = python;
packageOverrides = self: super: {
celery = super.celery.overridePythonAttrs rec {
optional-dependencies.redis = [ self.redis ];
};
# Version 3.0.5 is the last one to support SQLAlchemy 1.4
flask-multipass = self.callPackage ../flask-multipass { };
flask-pluginengine = self.callPackage ../flask-pluginengine { };
flask-sqlalchemy = super.flask-sqlalchemy.overridePythonAttrs rec {
version = "3.0.5";
src = fetchPypi {
pname = "flask_sqlalchemy";
inherit version;
hash = "sha256-xXZeWMoUVAG1IQbA9GF4VpJDxdolVWviwjHsxghnxbE=";
};
};
flask-webpackext = self.callPackage ../flask-webpackext { };
indico-fonts = self.callPackage ../indico-fonts { };
lxml = super.lxml.overridePythonAttrs rec {
optional-dependencies.html5 = [ self.html5lib ];
};
pynpm = self.callPackage ../pynpm { };
pywebpack = self.callPackage ../pywebpack { };
sentry-sdk = super.sentry-sdk_1;
sqlalchemy = super.sqlalchemy_1_4;
wtforms-dateutil = self.callPackage ../wtforms-dateutil { };
wtforms-sqlalchemy = self.callPackage ../wtforms-sqlalchemy { };
};
};
in
python.pkgs.buildPythonApplication rec {
pname = "indico";
version = "3.3.5";
pyproject = true;
disabled = python.pkgs.pythonOlder "3.12";
src = fetchFromGitHub {
owner = "indico";
repo = "indico";
rev = "refs/tags/v${version}";
hash = "sha256-OX5tqeIjd7Lb5XfvFFKcYb9Dbf5Z9QLXlVTepTpeOMU=";
};
build-system = with python.pkgs; [
hatchling
hatch-requirements-txt
];
patches = [
./remove_marshmallow_enum.patch
];
postPatch = ''
# See JoshData/python-email-validator#90
substituteInPlace requirements.in \
--replace "email-validator<1.3.0" "email-validator!=1.3.0"
# Botocore doesn't seem to be used anymore
substituteInPlace requirements.in --replace "urllib3<2" "urllib3"
# Seems fixed
substituteInPlace requirements.in --replace "pydyf<0.10" "pydyf"
# Remove transitive dependencies and unnecessary version pins
cp requirements.in requirements.txt
'';
dependencies =
with python.pkgs;
[
alembic
authlib
babel
bcrypt
bleach
blinker
captcha
celery
certifi
click
colorclass
distro
email-validator
feedgen
flask-babel
flask-caching
flask-cors
flask-limiter
flask-marshmallow
flask-migrate
flask-multipass
flask-pluginengine
flask-sqlalchemy
flask-webpackext
flask-wtf
flask
google-auth
hiredis
html2text
icalendar
indico-fonts
ipython
itsdangerous
jinja2
jsonschema
lxml
markdown
markupsafe
marshmallow-dataclass
marshmallow-oneofschema
marshmallow-sqlalchemy
marshmallow
packaging
pillow
prompt-toolkit
psycopg2
pycountry
pydyf
pygments
pypdf
python-dateutil
pytz
pywebpack
pyyaml
qrcode
redis
reportlab
requests
sentry-sdk
simplejson
speaklater
sqlalchemy
terminaltables
translitcodec
ua-parser
urllib3
wallet-py3k
weasyprint
webargs
werkzeug
wtforms
wtforms-dateutil
wtforms-sqlalchemy
xlsxwriter
]
++ bleach.optional-dependencies.css
++ celery.optional-dependencies.redis
++ qrcode.optional-dependencies.pil
++ lxml.optional-dependencies.html5
++ redis.optional-dependencies.hiredis
++ sentry-sdk_1.optional-dependencies.flask
++ sentry-sdk_1.optional-dependencies.celery
++ sentry-sdk_1.optional-dependencies.sqlalchemy
++ sentry-sdk_1.optional-dependencies.pure_eval
++ wtforms.optional-dependencies.email;
passthru = {
inherit python;
};
meta = {
description = "Full-featured conferency lifecycle management and meeting/lecture scheduling tool";
homepage = "https://getindico.io/";
changelog = "https://docs.getindico.io/en/stable/changelog/";
license = lib.licenses.mit;
};
}