From bfeae72f731dfa44850034db29347d8d0c9adf17 Mon Sep 17 00:00:00 2001 From: stitchy Date: Sat, 21 Dec 2024 18:54:43 -0800 Subject: [PATCH] refactor: move openssh config to a mkif --- hosts/default.nix | 6 ++++++ hosts/gemini/default.nix | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hosts/default.nix b/hosts/default.nix index 508f4eb..09b7e72 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -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"; nix.settings.experimental-features = [ "nix-command" "flakes" ]; }; diff --git a/hosts/gemini/default.nix b/hosts/gemini/default.nix index 5dfb66c..1a9cb36 100644 --- a/hosts/gemini/default.nix +++ b/hosts/gemini/default.nix @@ -18,12 +18,6 @@ networking.hostName = "gemini"; time.timeZone = "America/Los_Angeles"; - services.openssh = { - enable = true; - settings.PasswordAuthentication = false; - settings.KbdInteractiveAuthentication = false; - }; - # Open ports in the firewall. networking.firewall.allowedTCPPorts = [ 22 25565 ]; networking.firewall.allowedUDPPorts = [ 51820 ];