infrastructure/modules/nixos/dgn-ssh.nix

37 lines
718 B
Nix
Raw Permalink Normal View History

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