summaryrefslogtreecommitdiffstats
path: root/pkgs/simple
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-17 14:04:40 +0000
committertv <tv@krebsco.de>2026-11-17 15:07:12 +0100
commit2d18a83323be0e26451ac8b99f03bcbb68c2012e (patch)
treea9f084d334f5a5ecb153ae901d9e30b695b2555e /pkgs/simple
parente34b6de4e12507f2212106d5f3c182c84e2e82f5 (diff)
cgit-about-filter: check syntax at build time
cgit loads Lua filters at request time, and with caching enabled, a filter that fails to load produces an empty response and an error page in a cache lock file, with nothing in any log. Fail the build instead.
Diffstat (limited to 'pkgs/simple')
-rw-r--r--pkgs/simple/cgit-about-filter/default.nix16
1 files changed, 12 insertions, 4 deletions
diff --git a/pkgs/simple/cgit-about-filter/default.nix b/pkgs/simple/cgit-about-filter/default.nix
index a05020f..14b9aa9 100644
--- a/pkgs/simple/cgit-about-filter/default.nix
+++ b/pkgs/simple/cgit-about-filter/default.nix
@@ -1,6 +1,14 @@
-{ gitMinimal, lib, md4c, replaceVars }:
+{ gitMinimal, lib, luajit, md4c, replaceVarsWith }:
-replaceVars ./cgit-about-filter.lua {
- git = lib.getExe gitMinimal;
- md2html = lib.getExe md4c;
+replaceVarsWith {
+ src = ./cgit-about-filter.lua;
+ replacements = {
+ git = lib.getExe gitMinimal;
+ md2html = lib.getExe md4c;
+ };
+ # cgit runs Lua filters with LuaJIT. It reports errors in them only as
+ # an error page, which ends up in the cache rather than the response.
+ postCheck = ''
+ ${lib.getExe luajit} -b "$target" /dev/null
+ '';
}