mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-24 13:53:24 +00:00
gitea: create static gzip and brotli files
This commit is contained in:
parent
108d7c1e71
commit
57a7270642
@ -5,11 +5,15 @@
|
||||
, makeWrapper
|
||||
, git
|
||||
, bash
|
||||
, gitea
|
||||
, gzip
|
||||
, openssh
|
||||
, pam
|
||||
, sqliteSupport ? true
|
||||
, pamSupport ? true
|
||||
, runCommand
|
||||
, brotli
|
||||
, xorg
|
||||
, nixosTests
|
||||
}:
|
||||
|
||||
@ -61,7 +65,21 @@ buildGoModule rec {
|
||||
--prefix PATH : ${lib.makeBinPath [ bash git gzip openssh ]}
|
||||
'';
|
||||
|
||||
passthru.tests = nixosTests.gitea;
|
||||
passthru = {
|
||||
data-compressed = runCommand "data-compressed" {
|
||||
nativeBuildInputs = [ brotli xorg.lndir ];
|
||||
} ''
|
||||
mkdir $out
|
||||
lndir ${gitea.data}/ $out/
|
||||
|
||||
# Create static gzip and brotli files
|
||||
find -L $out -type f -regextype posix-extended -iregex '.*\.(css|html|js|svg|ttf|txt)' \
|
||||
-exec gzip --best --keep --force {} ';' \
|
||||
-exec brotli --best --keep --no-copy-stat {} ';'
|
||||
'';
|
||||
|
||||
tests = nixosTests.gitea;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Git with a cup of tea";
|
||||
|
Loading…
Reference in New Issue
Block a user