tvl-depot/third_party/cgit/default.nix
sterni db80c2d368 feat(3p/cgit): limit width of div#summary, i. e. /about/**
Decreased text width for the /about pages should increase readability
considerably as jumping back to the beginning is hard for longer
lines. The result is still not perfect as the font size for the /about
pages is rather small and many lines thus get broken somewhat awkwardly.

We could probably migitate that using a larger font size.

The implementation choice of adding a tvl-extra.css which we inject into
cgit.css in preBuild is for simplicity: We don't need to worry about
routing an extra CSS file and loading it from the right location via
extra cgit head entries and serving it at the correct location using
either nginx or thttpd.

A drawback of this is however that iteration is slowed down by cgit's
compilation time.

Additionally, this should be the basis for implementing a bubblegum
themed cgit for Profpatsch.

Change-Id: I18060f735167acd623cef7a17c83408978461249
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2756
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2021-04-02 10:24:41 +00:00

41 lines
1.2 KiB
Nix

{ depot, ... }:
let
inherit (depot.third_party) lib stdenv gzip bzip2 xz luajit zlib autoconf openssl pkgconfig;
in
stdenv.mkDerivation rec {
pname = "cgit";
version = "master";
src = ./.;
nativeBuildInputs = [ autoconf pkgconfig ];
buildInputs = [ openssl zlib luajit ];
enableParallelBuilding = true;
postPatch = ''
sed -e 's|"gzip"|"${gzip}/bin/gzip"|' \
-e 's|"bzip2"|"${bzip2.bin}/bin/bzip2"|' \
-e 's|"xz"|"${xz.bin}/bin/xz"|' \
-i ui-snapshot.c
'';
# Give cgit the git source tree from the depot. Note that the
# versions should be kept in sync (see the Makefile for the current
# git version).
preBuild = ''
rm -rf git # remove submodule dir ...
cp -r --no-preserve=ownership,mode ${depot.third_party.git.src} git
makeFlagsArray+=(prefix="$out" CGIT_SCRIPT_PATH="$out/cgit/")
cat tvl-extra.css >> cgit.css
'';
meta = {
homepage = https://git.zx2c4.com/cgit/about/;
repositories.git = git://git.zx2c4.com/cgit;
description = "Web frontend for git repositories";
license = lib.licenses.gpl2;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ bjornfor ];
};
}