aboutsummaryrefslogtreecommitdiffstats
path: root/apps/cgit
diff options
context:
space:
mode:
Diffstat (limited to 'apps/cgit')
-rw-r--r--apps/cgit/module.nix58
1 files changed, 43 insertions, 15 deletions
diff --git a/apps/cgit/module.nix b/apps/cgit/module.nix
index 106764b..593f8a5 100644
--- a/apps/cgit/module.nix
+++ b/apps/cgit/module.nix
@@ -1,16 +1,44 @@
{ appConfig, config, lib, pkgs, ... }:
-{
- services.cgit.default.enable = true;
- services.cgit.default.nginx.virtualHost = appConfig.domain;
- services.cgit.default.repos = lib.mapAttrs
- (name: attrs: {
- desc = attrs.description;
- path = "/var/lib/git/${name}";
- })
- appConfig.repositories;
- services.cgit.default.settings = appConfig.settings;
-
- users.users.git.isSystemUser = true;
- users.users.git.home = "/var/lib/git";
- users.users.git.group = "nogroup";
-}
+lib.mkMerge [
+ {
+ services.cgit.default.enable = true;
+ services.cgit.default.nginx.virtualHost = appConfig.domain;
+ # XXX https://github.com/NixOS/nixpkgs/issues/290524
+ services.cgit.default.package = pkgs.symlinkJoin {
+ name = "cgit";
+ paths = [
+ pkgs.cgit
+ (pkgs.luajit.withPackages (luaPackages: [ luaPackages.luaossl ]))
+ (pkgs.runCommandLocal "cgit-lua-packages" { } ''
+ mkdir -p $out/cgit
+ ln -s ../lib $out/cgit/lib
+ ln -s ../share $out/cgit/share
+ ''
+ )
+ ];
+ };
+ services.cgit.default.settings = appConfig.settings;
+ }
+ {
+ services.cgit.default.settings.about-filter = "${pkgs.cgit}/lib/cgit/filters/about-formatting.sh";
+ services.cgit.default.settings.commit-filter = "${pkgs.cgit}/lib/cgit/filters/commit-links.sh";
+ services.cgit.default.settings.email-filter = "lua:${pkgs.cgit}/lib/cgit/filters/email-libravatar.lua";
+ services.cgit.default.settings.source-filter = "${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py";
+ }
+ {
+ services.cgit.default.repos = lib.mapAttrs
+ (name: attrs: {
+ defbranch = "main";
+ desc = attrs.description;
+ #owner = "aforemny";
+ path = "/var/lib/git/${name}";
+ readme = "main:README.md";
+ })
+ appConfig.repositories;
+ }
+ {
+ users.users.git.isSystemUser = true;
+ users.users.git.home = "/var/lib/git";
+ users.users.git.group = "nogroup";
+ }
+]