aboutsummaryrefslogtreecommitdiff
path: root/nix/profiles/git-server.nix
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2025-07-21 07:31:45 -0700
committerFranck Cuny <franck@fcuny.net>2025-07-21 08:13:11 -0700
commit23f8df7396d35744069a4bda0d1d38a55ff64b79 (patch)
tree772b5e72355e9ee5b3ae31aef37fe1d4508e8f30 /nix/profiles/git-server.nix
parentadd docker helpers and clean up some dependencies (diff)
downloadinfra-23f8df7396d35744069a4bda0d1d38a55ff64b79.tar.gz
refactoring to use flake-parts and automatic imports of hosts
This is the first step in a large refactoring to use flake-parts, and to automatically imports hosts based on paths.
Diffstat (limited to 'nix/profiles/git-server.nix')
-rw-r--r--nix/profiles/git-server.nix25
1 files changed, 25 insertions, 0 deletions
diff --git a/nix/profiles/git-server.nix b/nix/profiles/git-server.nix
new file mode 100644
index 0000000..27eebc7
--- /dev/null
+++ b/nix/profiles/git-server.nix
@@ -0,0 +1,25 @@
+{ pkgs, ... }:
+{
+ services.gitolite = {
+ enable = true;
+ adminPubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINBkozy+X96u5ciX766bJ/AyQ3xm1tXZTIr5+4PVFZFi";
+ user = "git";
+ group = "git";
+ extraGitoliteRc = ''
+ # 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{LOCAL_CODE} = "$rc{GL_ADMIN_BASE}/local";
+ push( @{$RC{ENABLE}}, 'symbolic-ref' );
+ '';
+ };
+
+ # let's make sure the default branch is `main'.
+ systemd.tmpfiles.rules = [
+ "C /var/lib/gitolite/.gitconfig - git git 0644 ${pkgs.writeText "gitolite-gitconfig" ''
+ [init]
+ defaultBranch = main
+ ''}"
+ ];
+}