From 2efee4c1a79e34104dd8f70b2af3459a80baca21 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 28 Sep 2024 19:00:30 +0800 Subject: [PATCH] nixos/suites/server: fix default SSH server settings --- modules/nixos/_private/suites/server.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/nixos/_private/suites/server.nix b/modules/nixos/_private/suites/server.nix index e88efaf6..37fcd569 100644 --- a/modules/nixos/_private/suites/server.nix +++ b/modules/nixos/_private/suites/server.nix @@ -14,15 +14,15 @@ in }; config = lib.mkIf cfg.enable (lib.mkMerge [ - ({ - assertions = [{ + { + assertions = lib.singleton { assertion = !config.suites.desktop.enable || !config.suites.server.enable; message = '' Desktop profile is also enabled. The profiles `desktop` and `server` are mutually exclusive. ''; - }]; + }; # Set the time zone. We're making it easier to track by assigning a # universal time zone and what could be more universal than the @@ -36,15 +36,15 @@ in # Most servers will have to be accessed for debugging so it is here. But # be sure to set the appropriate public keys for the users from that # server. - services.openssh = lib.mkDefault { - enable = true; + services.openssh = { + enable = lib.mkDefault true; settings = { # Making it verbose for services such as fail2ban. LogLevel = "VERBOSE"; # Both are good for hardening as it only requires the keyfiles. - PasswordAuthentication = "no"; + PasswordAuthentication = false; PermitRootLogin = "no"; }; }; @@ -67,7 +67,7 @@ in # We're only going to deal with servers in English. i18n.defaultLocale = lib.mkForce "en_US.UTF-8"; i18n.supportedLocales = lib.mkForce [ "en_US.UTF-8/UTF-8" ]; - }) + } (lib.mkIf cfg.auto-upgrade.enable { system.autoUpgrade = {