Files
vmimages/modules/nixos/ssh/default.nix
2023-11-30 14:48:39 +00:00

23 lines
382 B
Nix

{
lib,
pkgs,
config,
...
}:
with lib; let
cfg = config.custom.sshd;
in {
#define option to enable this
options.custom.sshd.enable = mkEnableOption "Enable SSH";
config = mkIf cfg.enable {
services.openssh = {
enable = true;
permitRootLogin = "no";
passwordAuthentication = false;
};
networking.firewall.allowedTCPPorts = [22];
};
}