16 python = python3.override {
17 packageOverrides = final: prev: {
18 django = prev.django_5.overridePythonAttrs (old: {
19 dependencies = old.dependencies ++ prev.django_5.optional-dependencies.argon2;
21 sentry-sdk = prev.sentry-sdk_2;
22 djangorestframework = prev.djangorestframework.overridePythonAttrs (old: {
23 # https://github.com/encode/django-rest-framework/discussions/9342
24 disabledTests = (old.disabledTests or [ ]) ++ [ "test_invalid_inputs" ];
29 python.pkgs.buildPythonApplication rec {
40 src = fetchFromGitHub {
43 rev = "refs/tags/weblate-${version}";
44 hash = "sha256-cIwCNYXbg7l6z9OAkMAGJ783QI/nCOyrhLPURDcDv+Y=";
48 # https://github.com/WeblateOrg/weblate/commit/9695f912b0d24ae999d9442bb49719b4bb552696
50 # https://github.com/WeblateOrg/weblate/commit/1cf2a423b20fcd2dde18a43277311334e38208e7
52 # https://github.com/WeblateOrg/weblate/commit/3e34566fd7c151e1983586586bd7651cefe79585
57 # FIXME This shouldn't be necessary and probably has to do with some dependency mismatch.
61 build-system = with python.pkgs; [ setuptools ];
63 # Build static files into a separate output
66 staticSettings = writeText "static_settings.py" ''
68 STATIC_ROOT = os.environ["static"]
69 COMPRESS_OFFLINE = True
70 # So we don't need postgres dependencies
76 cat weblate/settings_example.py ${staticSettings} > weblate/settings_static.py
77 export DJANGO_SETTINGS_MODULE="weblate.settings_static"
78 ${python.pythonOnBuildForHost.interpreter} manage.py collectstatic --no-input
79 ${python.pythonOnBuildForHost.interpreter} manage.py compress
87 (toPythonModule (borgbackup.override { python3 = python; }))
91 django-crispy-bootstrap3
136 social-auth-app-django
142 weblate-language-data
145 ++ python-redis-lock.optional-dependencies.django
146 ++ celery.optional-dependencies.redis;
148 optional-dependencies = {
149 postgres = with python.pkgs; [ psycopg ];
152 # We don't just use wrapGAppsNoGuiHook because we need to expose GI_TYPELIB_PATH
153 GI_TYPELIB_PATH = lib.makeSearchPathOutput "out" "lib/girepository-1.0" [
160 makeWrapperArgs = [ "--set GI_TYPELIB_PATH \"$GI_TYPELIB_PATH\"" ];
164 # We need to expose this so weblate can work outside of calling its bin output
165 inherit GI_TYPELIB_PATH;
167 inherit (nixosTests) weblate;
172 description = "Web based translation tool with tight version control integration";
173 homepage = "https://weblate.org/";
174 license = with licenses; [
178 platforms = platforms.linux;
179 maintainers = with maintainers; [ erictapen ];