1

fix e11sync-static

This commit is contained in:
Motiejus Jakštys 2024-01-13 18:50:37 +02:00
parent 0a5abf6652
commit 187997f2a0

View File

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