aboutsummaryrefslogtreecommitdiff
path: root/profiles/git-server.nix
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2025-11-10 19:05:02 -0800
committerFranck Cuny <franck@fcuny.net>2025-11-10 19:05:02 -0800
commit9abecf6bfe12ba9d4acb5f8a22db281c4093d037 (patch)
tree0a5631e97ee6256472673096f5756a489924845e /profiles/git-server.nix
parentre-use gitolite as a git server (diff)
downloadinfra-9abecf6bfe12ba9d4acb5f8a22db281c4093d037.tar.gz
configure cgit
Diffstat (limited to '')
-rw-r--r--profiles/git-server.nix45
1 files changed, 43 insertions, 2 deletions
diff --git a/profiles/git-server.nix b/profiles/git-server.nix
index 3d34fad..d907580 100644
--- a/profiles/git-server.nix
+++ b/profiles/git-server.nix
@@ -1,4 +1,4 @@
-{ pkgs, ... }:
+{ pkgs, lib, ... }:
{
services.gitolite = {
enable = true;
@@ -9,7 +9,7 @@
# Make dirs/files group readable, needed for webserver/cgit. (Default
# setting is 0077.)
$RC{UMASK} = 0027;
- $RC{GIT_CONFIG_KEYS} = 'cgit.desc cgit.hide cgit.ignore cgit.owner';
+ $RC{GIT_CONFIG_KEYS} = 'cgit.desc cgit.hide cgit.ignore cgit.owner cgit.section';
$RC{LOCAL_CODE} = "$rc{GL_ADMIN_BASE}/local";
push( @{$RC{ENABLE}}, 'symbolic-ref' );
'';
@@ -24,4 +24,45 @@
''}"
];
+ services.cgit.main = {
+ enable = true;
+ package = pkgs.cgit-pink;
+ user = "git";
+ group = "git";
+ nginx.virtualHost = "code.fcuny.net";
+ scanPath = "/var/lib/gitolite/repositories";
+ settings = {
+ css = "/cgit.css";
+ logo = "/cgit.png";
+ favicon = "/favicon.ico";
+ robots = "noindex, nofollow";
+ readme = [
+ ":README.md"
+ ":README.org"
+ ];
+ project-list = "/var/lib/gitolite/projects.list";
+ about-filter = "${pkgs.cgit-pink}/lib/cgit/filters/about-formatting.sh";
+ source-filter = "${pkgs.cgit-pink}/lib/cgit/filters/syntax-highlighting.py";
+ clone-url = (lib.concatStringsSep " " [ "https://code.fcuny.net/$CGIT_REPO_URL" ]);
+ enable-log-filecount = 1;
+ enable-log-linecount = 1;
+ enable-git-config = 1;
+ enable-blame = 1;
+ enable-commit-graph = 1;
+ enable-follow-links = 1;
+ enable-index-owner = 0;
+ enable-index-links = 1;
+ enable-remote-branches = 1;
+ enable-subject-links = 1;
+ remove-suffix = 1;
+ enable-tree-linenumbers = 1;
+ max-atom-items = 108;
+ max-commit-count = 250;
+ max-repo-count = 500;
+ repository-sort = "age";
+ snapshots = "tar.gz";
+ root-title = "¯\\_(ツ)_/¯";
+ root-desc = "source code of my various projects";
+ };
+ };
}