add port to ssh module

This commit is contained in:
jacekpoz 2024-02-05 22:24:04 +01:00
parent ecc7622221
commit d172cfcb68
No known key found for this signature in database
GPG key ID: 94E812A8B12AAE3C

View file

@ -38,6 +38,11 @@ in {
description = "hostname to ssh into"; description = "hostname to ssh into";
type = types.str; type = types.str;
}; };
port = mkOption {
description = "port to ssh into";
type = with types; nullOr number;
default = null;
};
user = mkOption { user = mkOption {
description = "ssh user"; description = "ssh user";
type = types.str; type = types.str;
@ -77,6 +82,7 @@ in {
${concatStrings (mapAttrsToList (name: value: '' ${concatStrings (mapAttrsToList (name: value: ''
Host ${name} Host ${name}
HostName ${value.hostName} HostName ${value.hostName}
${if value.port != null then "Port ${toString value.port}" else ""}
User ${value.user} User ${value.user}
IdentityFile ${value.identityFile} IdentityFile ${value.identityFile}
IdentitiesOnly ${if value.identitiesOnly then "yes" else "no"} IdentitiesOnly ${if value.identitiesOnly then "yes" else "no"}