Files
nix/modules/system/ssh/default.nix
2025-10-25 14:36:52 -05:00

25 lines
471 B
Nix
Executable File

{ 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 = true;
PermitRootLogin = "no";
X11Forwarding = false;
};
};
# open firewall
networking.firewall.allowedTCPPorts = [ 22 ];
};
}