refactor: move openssh config to a mkif

This commit is contained in:
stitchy 2024-12-21 18:54:43 -08:00
parent aa269aa681
commit bfeae72f73
Signed by: stitchy
SSH key fingerprint: SHA256:f7Wxv5r7Ooi4z3GxqMBx50LlPRtY/kUK/Sw8K02PYys
2 changed files with 6 additions and 6 deletions

View file

@ -84,6 +84,12 @@ in
''; '';
})]; })];
services.openssh = lib.mkIf (config.stitchyconf.form == "server"){
enable = true;
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
};
environment.etc.hosts.mode = "0644"; environment.etc.hosts.mode = "0644";
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
}; };

View file

@ -18,12 +18,6 @@
networking.hostName = "gemini"; networking.hostName = "gemini";
time.timeZone = "America/Los_Angeles"; time.timeZone = "America/Los_Angeles";
services.openssh = {
enable = true;
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
};
# Open ports in the firewall. # Open ports in the firewall.
networking.firewall.allowedTCPPorts = [ 22 25565 ]; networking.firewall.allowedTCPPorts = [ 22 25565 ];
networking.firewall.allowedUDPPorts = [ 51820 ]; networking.firewall.allowedUDPPorts = [ 51820 ];