From d172cfcb68cc19445568305024f86b658bc485ba Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Mon, 5 Feb 2024 22:24:04 +0100 Subject: [PATCH] add port to ssh module --- modules/services/ssh.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/services/ssh.nix b/modules/services/ssh.nix index e94c48b4..b9a6170d 100644 --- a/modules/services/ssh.nix +++ b/modules/services/ssh.nix @@ -38,6 +38,11 @@ in { description = "hostname to ssh into"; type = types.str; }; + port = mkOption { + description = "port to ssh into"; + type = with types; nullOr number; + default = null; + }; user = mkOption { description = "ssh user"; type = types.str; @@ -77,6 +82,7 @@ in { ${concatStrings (mapAttrsToList (name: value: '' Host ${name} HostName ${value.hostName} + ${if value.port != null then "Port ${toString value.port}" else ""} User ${value.user} IdentityFile ${value.identityFile} IdentitiesOnly ${if value.identitiesOnly then "yes" else "no"}