move e11sync-static to it's own file
This commit is contained in:
33
pkgs/e11sync-static.nix
Normal file
33
pkgs/e11sync-static.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
self,
|
||||
stdenv,
|
||||
python3,
|
||||
python3Packages,
|
||||
coreutils,
|
||||
zopfli,
|
||||
brotli,
|
||||
findutils,
|
||||
dart-sass,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
name = "e11sync-static";
|
||||
src = self;
|
||||
nativeBuildInputs = [
|
||||
python3Packages.django_5
|
||||
python3Packages.django-compressor
|
||||
dart-sass
|
||||
];
|
||||
buildPhase = ''
|
||||
mkdir -p static
|
||||
export E11SYNC_STATIC_ROOT=static
|
||||
export E11SYNC_DEBUG=
|
||||
export E11SYNC_COMPRESS_OFFLINE=1
|
||||
${python3}/bin/python3 ${self}/app/manage.py collectstatic
|
||||
${python3}/bin/python3 ${self}/app/manage.py compress
|
||||
|
||||
${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'';
|
||||
}
|
||||
Reference in New Issue
Block a user