1
Fork 0

fix e11sync-static

This commit is contained in:
Motiejus Jakštys 2024-01-13 18:50:37 +02:00
parent 0a5abf6652
commit 187997f2a0
1 changed files with 9 additions and 8 deletions

View File

@ -61,18 +61,19 @@
name = "e11sync-static";
src = self;
nativeBuildInputs = buildDeps;
buildPhase = ''
mkdir -p $out/static
export E11SYNC_STATIC_ROOT=$out/static
buildPhase = with pkgs; ''
mkdir -p static
export E11SYNC_STATIC_ROOT=static
export E11SYNC_DEBUG=
export E11SYNC_COMPRESS_OFFLINE=1
${pkgs.python3}/bin/python3 ${self}/app/manage.py collectstatic
${pkgs.python3}/bin/python3 ${self}/app/manage.py compress
${python3}/bin/python3 ${self}/app/manage.py collectstatic
${python3}/bin/python3 ${self}/app/manage.py compress
${pkgs.findutils}/bin/find $out/static/CACHE -name '*.css' | \
${pkgs.findutils}/bin/xargs -P8 -I{} sh -c \
"${pkgs.zopfli}/bin/zopfli {} && ${pkgs.brotli}/bin/brotli {}"
${findutils}/bin/find static/CACHE -name '*.css' | \
${findutils}/bin/xargs -P''$(${coreutils}/bin/nproc) -I{} sh -c \
"${zopfli}/bin/zopfli {} && ${brotli}/bin/brotli {}"
'';
installPhase = ''mv static $out'';
};
packages.e11sync-gunicorn = pkgs.stdenv.mkDerivation {
name = "e11sync-gunicorn";