Commit 0aedd2e

HPCesia <me@hpcesia.com>
2026-09-25 16:54:32
forgejo: use ssh config instead of global tailscale dns
1 parent 5f70ea0
Changed files (2)
modules
core
services
forgejo
modules/core/openssh.nix
@@ -77,6 +77,20 @@ in {
         openFirewall = false;
       };
 
+      programs.ssh = {
+        extraConfig = ''
+          Host github.com
+            HostName ssh.github.com
+            Port 443
+            User git
+
+          Host git.trin.one
+            HostName cyrene
+            Port 22
+            User git
+        '';
+      };
+
       users.users.root.openssh.authorizedKeys.keys =
         host.settings.core.openssh.authorizedKeys;
 
modules/services/forgejo/server.nix
@@ -1,8 +1,4 @@
-{
-  den,
-  lib,
-  ...
-}: {
+{lib, ...}: {
   den.aspects.services.forgejo.server = {
     settings.host = {
       domain = lib.mkOption {
@@ -23,7 +19,6 @@
     in {
       ${cfg.domain} = {
         port = cfg.port;
-        prefer = "tailscale";
       };
     };
 
@@ -64,11 +59,6 @@
             DOMAIN = hostCfg.domain;
             HTTP_ADDR = hostCfg.address;
             HTTP_PORT = hostCfg.port;
-            # Tailnet deployments use port 22, public ones the openssh port.
-            SSH_PORT =
-              if lib.hasSuffix ".${den.aspects.services.caddy.tailnetDomain}" hostCfg.domain
-              then 22
-              else host.settings.core.openssh.server.port;
             PROTOCOL = "http";
             ROOT_URL = "https://${hostCfg.domain}/";
           };