mirror of
https://github.com/sstent/vmimages.git
synced 2026-01-25 14:41:44 +00:00
20 lines
359 B
Nix
20 lines
359 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 ];
|
|
|
|
};
|
|
} |