nichts/modules/services/ssh.nix

21 lines
532 B
Nix
Raw Normal View History

2024-11-01 13:49:42 +01:00
{lib, ...}: let
inherit (lib.options) mkEnableOption;
in {
options.modules.programs.ssh.enable = mkEnableOption "ssh";
2024-07-21 21:58:18 +02:00
config = {
2025-04-12 10:02:21 +02:00
# set the ssh socket globally. This alows all applications and shells to use
# the ssh-agent.
environment.sessionVariables.SSH_AUTH_SOCK = "/run/user/1000/ssh-agent";
2024-07-21 21:58:18 +02:00
programs.ssh.startAgent = true;
2025-03-04 22:32:40 +01:00
2024-07-21 21:58:18 +02:00
services.openssh = {
enable = true;
2025-03-04 22:43:09 +01:00
ports = [22];
2024-07-21 21:58:18 +02:00
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
};
}