Open aforemny opened 8 months ago
I'm afraid I won't be of much help here, but I have two things to say:
services.lighttpd = {
...
# Inject a python that can be used for this cgitrc snippet:
# source-filter=${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py
extraConfig = lib.mkAfter ''
$HTTP["url"] =~ "^/cgit" {
setenv.add-environment += (
${let
pythonEnv = pkgs.python3.buildEnv.override {
extraLibs = with pkgs.python3Packages; [ pygments ];
};
cgitPath = with pkgs; lib.makeBinPath [ pythonEnv ];
in ''
"PATH" => "${cgitPath}:" + env.PATH
''}
)
}
'';
...
Describe the bug
I am trying to use lua filters with
services.cgit
, in particular lua filters that require lua libraries. I've only found a non-intuitive solution to make this work.Steps To Reproduce
Steps to reproduce the behavior:
email-libravatar.lua
as an email filter. This lua script depends on the lua moduleluaossl
.configuration:
error:
Expected behavior
I would expect to have a documented/ non-obscure way to use lua filters in cgit that use lua modules.
Overriding
luagit
incgit
does not alleviate the error, presumably (but I haven't checked), because cgit links against lua, instead of calling our wrapper binary. Ie. extending above configuration with the following does not alleviate the problem.Additional context
I've come up with the following work-around.
This works, because
fcgiwrap
executes cgit with${pkgs.cgit}/cgit
as working directory.Note that
libravatar.lua
importsopenssl/digest
, which is found inshare
, which in turn loads_openssl.so
, which is found inlib
.How could we approve upon this? Ideally, I would like the
luajit
override inservices.cgit.main.package
to work, or exposeservices.cgit.*.luaPackages
as a configuration option. For that to be robust, I feel we should controlfcgiwrap
's working directory better, ie. specify it to be${pkgs.cgit}
instead of${pkgs.cgit}/cgit
?Or is there a simple solution that I've missed? Thank you for your input!
Notify maintainers
@bjornfor (package maintainer)
Metadata
This was tested on nixos-23.11, rev 84d981bae8b5e783b3b548de505b22880559515f.
Add a :+1: reaction to issues you find important.