nix-conf/modules/system/ssh/default.nix

28 lines
591 B
Nix
Raw Normal View History

2023-02-24 12:35:58 +01:00
{ options, config, pkgs, lib, ... }:
with lib;
#with lib.internal;
let cfg = config.custom.system.ssh;
in
{
options.custom.system.ssh = with types; {
enable = mkBoolOpt false "Whether or not to enable ssh.";
};
config = mkIf cfg.enable {
2023-04-05 09:19:06 +02:00
services.openssh = {
enable = true;
2023-04-05 09:36:47 +02:00
ports = [ 22 ];
openFirewall = true;
2023-04-05 09:24:11 +02:00
settings = {
X11forwarding = true;
2023-04-05 09:36:47 +02:00
PermitRootLogin = "no";
2023-04-05 09:24:11 +02:00
passwordAuthentication = false;
kbdInteractiveAuthentication = false;
};
2023-04-05 09:21:51 +02:00
};
2023-03-06 12:57:17 +01:00
environment.systemPackages = with pkgs; [ sshfs ];
2023-02-24 12:35:58 +01:00
};
}