services.openssh.listenAddresses

List of addresses and ports to listen on (ListenAddress directive in config). If port is not specified for address sshd will listen on all ports specified by ports option. NOTE: this will override default listening on all local addresses and port 22. NOTE: setting this option won't automatically enable given ports in firewall configuration. NOTE: If the IP address is not available at boot time, the following has to be added to make sure sshd will wait for dhcp configuration:

systemd.services.sshd = {
  wants = [ "network-online.target" ];
  after = [ "network-online.target" ];
};

See the following issue for details: https://github.com/NixOS/nixpkgs/issues/105570

Type
list of (submodule)
Default
[ ]
Example
[
  {
    addr = "192.168.3.1";
    port = 22;
  }
  {
    addr = "0.0.0.0";
    port = 64022;
  }
]
Declared
<nixpkgs/nixos/modules/services/networking/ssh/sshd.nix>