summaryrefslogtreecommitdiff
path: root/modules/nixos/openssh.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nixos/openssh.nix')
-rw-r--r--modules/nixos/openssh.nix19
1 files changed, 7 insertions, 12 deletions
diff --git a/modules/nixos/openssh.nix b/modules/nixos/openssh.nix
index 4324e45..9b82757 100644
--- a/modules/nixos/openssh.nix
+++ b/modules/nixos/openssh.nix
@@ -1,11 +1,9 @@
-{
- config,
- lib,
- ...
-}:
-with lib; let
+{ config, lib, ... }:
+with lib;
+let
cfg = config.nixfiles.modules.openssh;
-in {
+in
+{
options.nixfiles.modules.openssh.server = {
enable = mkEnableOption "OpenSSH server";
@@ -29,15 +27,12 @@ in {
services = {
openssh = {
enable = true;
- ports = [cfg.server.port];
+ ports = [ cfg.server.port ];
settings = {
ClientAliveCountMax = 3;
ClientAliveInterval = 60;
KbdInteractiveAuthentication = false;
- LogLevel =
- if config.nixfiles.modules.fail2ban.enable
- then "VERBOSE"
- else "ERROR";
+ LogLevel = if config.nixfiles.modules.fail2ban.enable then "VERBOSE" else "ERROR";
MaxAuthTries = 3;
PasswordAuthentication = false;
PermitRootLogin = mkForce "no";