summary refs log tree commit diff
path: root/nixos/modules/services/misc/gitea.nix
diff options
context:
space:
mode:
authorIzorkin <izorkin@elven.pw>2020-08-01 12:03:38 +0300
committerIzorkin <izorkin@elven.pw>2020-08-05 11:19:32 +0300
commit6c258a7c212fed4b4cdf13f5a2957f98989675ff (patch)
tree79f12788047875590c0543959b687cc8fb228279 /nixos/modules/services/misc/gitea.nix
parentdfd32f11f3ff1da571e499ed993dff99037e73bd (diff)
downloadnixpkgs-6c258a7c212fed4b4cdf13f5a2957f98989675ff.tar
nixpkgs-6c258a7c212fed4b4cdf13f5a2957f98989675ff.tar.gz
nixpkgs-6c258a7c212fed4b4cdf13f5a2957f98989675ff.tar.bz2
nixpkgs-6c258a7c212fed4b4cdf13f5a2957f98989675ff.tar.lz
nixpkgs-6c258a7c212fed4b4cdf13f5a2957f98989675ff.tar.xz
nixpkgs-6c258a7c212fed4b4cdf13f5a2957f98989675ff.tar.zst
nixpkgs-6c258a7c212fed4b4cdf13f5a2957f98989675ff.zip
nixos/gitea: add ssh options
Diffstat (limited to 'nixos/modules/services/misc/gitea.nix')
-rw-r--r--nixos/modules/services/misc/gitea.nix26
1 files changed, 26 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/gitea.nix b/nixos/modules/services/misc/gitea.nix
index 6c6541b9369..7fb6be5ea84 100644
--- a/nixos/modules/services/misc/gitea.nix
+++ b/nixos/modules/services/misc/gitea.nix
@@ -170,6 +170,25 @@ in
         };
       };
 
+      ssh = {
+        enable = mkOption {
+          type = types.bool;
+          default = true;
+          description = "Enable external SSH feature.";
+        };
+
+        clonePort = mkOption {
+          type = types.int;
+          default = 22;
+          example = 2222;
+          description = ''
+            SSH port displayed in clone URL.
+            The option is required to configure a service when the external visible port
+            differs from the local listening port i.e. if port forwarding is used.
+          '';
+        };
+      };
+
       appName = mkOption {
         type = types.str;
         default = "gitea: Gitea Service";
@@ -327,6 +346,13 @@ in
           HTTP_ADDR = cfg.httpAddress;
           HTTP_PORT = cfg.httpPort;
         })
+        (mkIf cfg.ssh.enable {
+          DISABLE_SSH = false;
+          SSH_PORT = cfg.ssh.clonePort;
+        })
+        (mkIf (!cfg.ssh.enable) {
+          DISABLE_SSH = true;
+        })
       ];
 
       session = {