From 4215714cb11f2546b75a4316dc663ebe890a4fb6 Mon Sep 17 00:00:00 2001 From: Silas Schöffel Date: Wed, 5 Jun 2024 19:27:15 +0200 Subject: feat(treewide): add git-server module --- modules/nixos/vhack/git-server.nix | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 modules/nixos/vhack/git-server.nix (limited to 'modules/nixos/vhack/git-server.nix') diff --git a/modules/nixos/vhack/git-server.nix b/modules/nixos/vhack/git-server.nix new file mode 100644 index 0000000..162dcd0 --- /dev/null +++ b/modules/nixos/vhack/git-server.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.vhack.git-server; +in { + options.vhack.git-server.enable = lib.mkEnableOption "a lightweight git-server, + realised with cgit and gitolite."; + config = lib.mkIf cfg.enable { + services = { + gitolite = { + enable = true; + adminPubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAe4o1PM6VasT3KZNl5NYvgkkBrPOg36dqsywd10FztS openpgp:0x21D20D6A"; + dataDir = "/srv/gitolite"; + user = "gitolite"; + group = "gitolite"; + extraGitoliteRc = '' + $RC{UMASK} = 0027; # Enable group access, important for cgit. + ''; + }; + cgit."git.vhack.eu" = { + enable = true; + package = pkgs.cgit-pink; + scanPath = "${config.services.gitolite.dataDir}/repositories"; + settings = { + section-from-path = true; + project-list = "${config.services.gitolite.dataDir}/projects.list"; + source-filter = "${config.services.cgit."git.vhack.eu".package}/lib/cgit/filters/syntax-highlighting.py"; + }; + }; + }; + }; +} -- cgit 1.4.1