summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flora/services/0001-main-instead-of-master-branch.patch25
-rw-r--r--flora/services/cgit.nix7
2 files changed, 31 insertions, 1 deletions
diff --git a/flora/services/0001-main-instead-of-master-branch.patch b/flora/services/0001-main-instead-of-master-branch.patch
new file mode 100644
index 0000000..21f6b00
--- /dev/null
+++ b/flora/services/0001-main-instead-of-master-branch.patch
@@ -0,0 +1,25 @@
+From 9f4e165702819bdab78403e4145db517b915df95 Mon Sep 17 00:00:00 2001
+From: stuebinm <stuebinm@disroot.org>
+Date: Wed, 14 Sep 2022 15:08:32 +0200
+Subject: [PATCH] main instead of master branch
+
+---
+ cgit.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cgit.c b/cgit.c
+index 08d81a1..5b0a016 100644
+--- a/cgit.c
++++ b/cgit.c
+@@ -489,7 +489,7 @@ static char *guess_defbranch(void)
+
+ ref = resolve_ref_unsafe("HEAD", 0, &oid, NULL);
+ if (!ref || !skip_prefix(ref, "refs/heads/", &refname))
+- return "master";
++ return "main";
+ return xstrdup(refname);
+ }
+
+--
+2.36.0
+
diff --git a/flora/services/cgit.nix b/flora/services/cgit.nix
index e72f276..f5ef52a 100644
--- a/flora/services/cgit.nix
+++ b/flora/services/cgit.nix
@@ -47,12 +47,17 @@ let
cache-scanrc-ttl=1
+ defbranch=main
scan-path=/var/git/public
section=Forks
clone-url=https://stuebinm.eu/git/forks/$CGIT_REPO_URL
scan-path=/var/git/forks
'';
+
+ cgit = pkgs.cgit.overrideAttrs (old: {
+ patches = [./0001-main-instead-of-master-branch.patch];
+ });
in
{
services.fcgiwrap = {
@@ -68,7 +73,7 @@ in
locations."~ /git(/.*)".extraConfig = ''
fastcgi_pass unix:${config.services.fcgiwrap.socketAddress};
include ${pkgs.nginx}/conf/fastcgi_params;
- fastcgi_param SCRIPT_FILENAME ${pkgs.cgit}/cgit/cgit.cgi;
+ fastcgi_param SCRIPT_FILENAME ${cgit}/cgit/cgit.cgi;
fastcgi_param CGIT_CONFIG ${pkgs.writeText "cgit.conf" cgitconf};
fastcgi_param PATH_INFO $1;
'';