{ lib , python , fetchFromGitHub , buildPythonPackage , callPackage , writeText , fetchpatch # build systems , hatchling # deps , bleach , celery , django-crispy-bootstrap5 , django , django-activity-stream ? callPackage ./django-activity-stream.nix {} , django-axes , django-compressor , django-cors-headers , django-crispy-forms , django-email-verification ? callPackage ./django-email-verification.nix {} , django-environ , django-filter , django-formtools , django-prometheus , django-recaptcha ? callPackage ./django-recaptcha.nix {} , django-simple-history , django-sortedm2m ? callPackage ./django-sortedm2m.nix {} , django-storages , djangorestframework , djangorestframework-simplejwt , drf-spectacular , easy-thumbnails , flower , fontawesomefree , icalendar , invoke , openfoodfacts ? callPackage ./openfoodfacts.nix {} , pillow , reportlab , requests , tqdm , tzdata # extra deps , redis , django-redis , drf-spectacular-sidecar , django-bootstrap-breadcrumbs ? callPackage ./django-bootstrap-breadcrumbs.nix {} , psycopg2 }: let frontend = callPackage ./frontend.nix {}; in buildPythonPackage rec { pname = "wger"; version = "2.3"; pyproject = true; # src = fetchFromGitHub { # owner = "wger-project"; # repo = "wger"; # rev = version; # hash = "sha256-riJyVl0/GwAGkcHVzkJc666owPk1E4ca8DV5qTjEbjk="; # }; # TMP: until it's merged src = fetchFromGitHub { owner = "eyJhb"; repo = "wger"; rev = "proxyauthheaderv2"; hash = "sha256-9GMU7CSMKcgBFYrUh6m9LFiJQ7XLkhaJ8EPt+FSZFqY="; }; # src = /tmp/wger; build-system = [ hatchling ]; patches = [ ./patches/pyproject.patch ./patches/manage.patch ./patches/exercises-no-gifs.patch ]; propagatedBuildInputs = [ bleach celery django-crispy-bootstrap5 django django-activity-stream django-axes django-compressor django-cors-headers django-crispy-forms django-email-verification django-environ django-filter django-formtools django-prometheus django-recaptcha django-simple-history django-sortedm2m django-storages djangorestframework djangorestframework-simplejwt drf-spectacular easy-thumbnails flower fontawesomefree icalendar invoke openfoodfacts pillow reportlab requests tqdm tzdata # extra?? redis django-redis drf-spectacular-sidecar django-bootstrap-breadcrumbs psycopg2 ]; postPatch = '' cp manage.py wger/manage.py ''; # fixup compressed files postBuild = let staticSettings = writeText "static_settings.py" '' import os DEBUG = False STATIC_ROOT = os.environ["static"] COMPRESS_OFFLINE = True # So we don't need postgres dependencies DATABASES = {} ''; in '' # copy over static yarn things # cp -a ${frontend}/static/yarn $out/${python.sitePackages}/wger/core/static cp -a ${frontend}/static/yarn wger/core/static python3 -m wger create-settings -s $PWD/tmp_settings.py cat ${staticSettings} >> $PWD/tmp_settings.py mkdir tmpstatic pushd tmpstatic static=. WGER_SETTINGS=../tmp_settings.py python ../manage.py collectstatic --no-input static=. WGER_SETTINGS=../tmp_settings.py python ../manage.py compress --force popd ''; postInstall = '' rm -rf $out/${python.sitePackages}/wger/core/static cp -a tmpstatic $out/${python.sitePackages}/wger/core/static mkdir $out/share cp -a $out/${python.sitePackages}/wger/core/static $out/share ''; pythonImportsCheck = [ "wger" ]; meta = { description = ""; homepage = "https://github.com/wger-project/wger"; license = lib.licenses.agpl3Only; maintainers = with lib.maintainers; [ eyjhb ]; mainProgram = "wger"; }; }