nixos-config/modules/server/network.nix

22 lines
476 B
Nix
Raw Normal View History

2023-11-12 00:40:26 +01:00
{ lib, config, ... }:
with lib;
{
config = {
services.openssh = {
2023-11-12 00:40:26 +01:00
enable = true;
2024-07-27 11:43:04 +02:00
settings = {
StrictModes = true;
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
PermitEmptyPasswords = "no";
};
2023-11-12 00:40:26 +01:00
};
networking.firewall.allowedTCPPorts = [
(mkIf config.services.nginx.enable 80)
(mkIf config.services.nginx.enable 443)
(mkIf config.services.openssh.enable 22)
2023-11-12 00:40:26 +01:00
];
};
}