From 85af45a3dddcc52ca80f4fe4fd4d1606755f744b Mon Sep 17 00:00:00 2001 From: Nathan Gill Date: Mon, 7 Sep 2026 23:06:48 +0100 Subject: [PATCH] user: set default `sshKeys` --- lib/user.nix | 2 +- modules/system/sshd/default.nix | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/lib/user.nix b/lib/user.nix index f58f310..a54dc3a 100644 --- a/lib/user.nix +++ b/lib/user.nix @@ -7,7 +7,7 @@ groups, uid, shell, - sshKeys, + sshKeys ? [ ], ... }: { diff --git a/modules/system/sshd/default.nix b/modules/system/sshd/default.nix index 0ac0f57..68abf10 100644 --- a/modules/system/sshd/default.nix +++ b/modules/system/sshd/default.nix @@ -8,7 +8,8 @@ with lib; let cfg = config.olduser101.sshd; -in { +in +{ options.olduser101.sshd = { enable = mkOption { type = types.bool; @@ -24,17 +25,17 @@ in { }; config = mkIf cfg.enable { - services.openssh = { - enable = true; - openFirewall = true; - settings = { - PasswordAuthentication = false; - KbdInteractiveAuthentication = false; - PermitRootLogin = "no"; - MaxAuthTries = 3; - AllowUsers = cfg.users; - PerSourcePenalties = "crash:3600s authfail:3600s max:86400s"; - }; - }; + services.openssh = { + enable = true; + openFirewall = true; + settings = { + PasswordAuthentication = false; + KbdInteractiveAuthentication = false; + PermitRootLogin = "no"; + MaxAuthTries = 3; + AllowUsers = cfg.users; + PerSourcePenalties = "crash:3600s authfail:3600s max:86400s"; + }; + }; }; } -- 2.51.2