Files
nix/modules/system/ssh/default.nix
T
2026-08-23 14:49:55 -05:00

27 lines
492 B
Nix

{
pkgs,
config,
lib,
...
}: let
cfg = config.system.ssh;
in {
options.system.ssh = {
enable = lib.mkEnableOption "enables ssh";
};
config = lib.mkIf cfg.enable {
# enable and configure openssh
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "prohibit-password";
X11Forwarding = false;
};
};
# open firewall
networking.firewall.allowedTCPPorts = [22];
};
}