22 lines
466 B
Nix
22 lines
466 B
Nix
{
|
|
runCommand,
|
|
zopfli,
|
|
brotli,
|
|
findutils,
|
|
e11sync-djangostatic,
|
|
}:
|
|
runCommand "e11sync-static" {
|
|
src = e11sync-djangostatic;
|
|
nativeBuildInputs = [findutils];
|
|
} ''
|
|
unpackPhase
|
|
find e11sync-djangostatic \
|
|
-name '*.css' -or \
|
|
-name '*.js' -or \
|
|
-name '*.svg' -or \
|
|
-name '*.txt' | \
|
|
tee >(xargs -n1 -P''$(nproc) ${zopfli}/bin/zopfli) | \
|
|
xargs -n1 -P''$(nproc) ${brotli}/bin/brotli
|
|
mv e11sync-djangostatic $out
|
|
''
|