2024-12-12 14:41:43 +01:00
|
|
|
# SPDX-FileCopyrightText: 2024 Maurice Debray <maurice.debray@dgnum.eu>
|
|
|
|
# SPDX-FileCopyrightText: 2024 Tom Hubrecht <tom.hubrecht@dgnum.eu>
|
2023-05-22 16:47:13 +02:00
|
|
|
#
|
2024-12-12 14:41:43 +01:00
|
|
|
# SPDX-License-Identifier: EUPL-1.2
|
2023-05-22 16:47:13 +02:00
|
|
|
|
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
let
|
2024-01-30 10:22:27 +01:00
|
|
|
inherit (lib) mkEnableOption mkIf;
|
2023-07-18 17:00:51 +02:00
|
|
|
|
2023-05-22 16:47:13 +02:00
|
|
|
cfg = config.dgn-ssh;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options.dgn-ssh = {
|
2024-01-30 10:22:27 +01:00
|
|
|
enable = mkEnableOption "ssh default configuration." // {
|
|
|
|
default = true;
|
|
|
|
};
|
2023-05-22 16:47:13 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
|
2024-01-30 10:22:27 +01:00
|
|
|
settings = {
|
|
|
|
KbdInteractiveAuthentication = false;
|
2024-02-26 14:33:39 +01:00
|
|
|
LoginGraceTime = "30";
|
|
|
|
MaxSessions = "64";
|
|
|
|
MaxStartups = "64";
|
|
|
|
PasswordAuthentication = false;
|
2024-01-30 10:22:27 +01:00
|
|
|
};
|
2023-05-22 16:47:13 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
programs.mosh.enable = true;
|
|
|
|
};
|
|
|
|
}
|