2022-06-23 02:57:41 -04:00
|
|
|
{ config, lib, pkgs, ... }:
|
2022-10-13 22:13:43 -04:00
|
|
|
let nathan = config.nathan;
|
|
|
|
in with lib; {
|
2022-06-23 02:57:41 -04:00
|
|
|
config = mkIf nathan.services.ssh {
|
|
|
|
networking.firewall = {
|
|
|
|
allowedTCPPorts = [ 22 ];
|
|
|
|
allowedUDPPorts = [ 22 ];
|
|
|
|
};
|
|
|
|
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
extraConfig = ''
|
|
|
|
StreamLocalBindUnlink yes
|
|
|
|
'';
|
2022-10-13 22:13:43 -04:00
|
|
|
listenAddresses = [{
|
|
|
|
addr = "0.0.0.0";
|
|
|
|
port = 22;
|
|
|
|
}];
|
2023-05-30 09:18:20 -04:00
|
|
|
settings = {
|
|
|
|
PasswordAuthentication = false;
|
|
|
|
PermitRootLogin = "no";
|
|
|
|
};
|
2022-06-23 02:57:41 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
# Enable mosh for connecting from phone or bad internet
|
|
|
|
programs.mosh.enable = true;
|
|
|
|
};
|
|
|
|
}
|