]> git.dkaiser.de - config/nixos.git/commitdiff
Setup git-server on antares
authorDominik Kaiser <dominik-kaiser@mailbox.org>
Sun, 16 Feb 2025 21:21:31 +0000 (22:21 +0100)
committerDominik Kaiser <dominik-kaiser@mailbox.org>
Sun, 16 Feb 2025 21:21:31 +0000 (22:21 +0100)
hosts/antares/configuration.nix

index 494af512766d5ee9e3e130443d6bda22e4c51a8b..51511258108483d92676d28ce46a803511d9a879 100644 (file)
       PasswordAuthentication = false;
       PermitRootLogin = "no";
     };
+    extraConfig = ''
+      Match user git
+        AllowTcpForwarding no
+       AllowAgentForwarding no
+       PasswordAuthentication no
+       PermitTTY no
+       X11Forwarding no
+    '';
   };
 
   networking.hostName = "antares";
   };
 
   services.gitweb = {
-    projectroot = "/home/git";
+    projectroot = "/srv/git";
+    gitwebTheme = true;
+    extraConfig = ''
+      our $site_name = 'git.dkaiser.de';
+      $omit_owner = true;
+      $projects_list_description_width = 25;
+    '';
   };
 
   services.nginx = {
 
     gitweb = {
       enable = true;
-      virtualHost = "dkaiser.de";
+      location = "";
+      virtualHost = "git.dkaiser.de";
     };
     recommendedGzipSettings = true;
     recommendedOptimisation = true;
     recommendedProxySettings = true;
     recommendedTlsSettings = true;
-
-    virtualHosts = "dkaiser.de" = {
-      forceSSL = true;
-      enableACME = true;
-    };
   };
 
   environment.systemPackages = map lib.lowPrio [
     ];
   };
   users.users.git = {
-    isNormalUser = true;
+    isSystemUser = true;
     description = "git";
-    extraGroups = [ ];
+    group = "git";
+    home = "/srv/git";
+    createHome = true;
+    shell = "${pkgs.git}/bin/git-shell";
     openssh.authorizedKeys.keys = [
       "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICtL2eG098LhkFPR4N5e44XMq60uvCUCOuKMYs5zjg6f"
     ];
   };
 
+  users.groups.git = {};
+
   system.stateVersion = "24.05";
 }