33 lines
682 B
Nix
Raw Normal View History

2025-05-13 14:26:22 +02:00
{ lib, config, ... }:
with lib;
let
cfg = config.modules.ssh;
in
{
options.modules.ssh = {
enable = mkEnableOption "ssh";
};
config = mkIf cfg.enable {
2025-05-30 16:15:52 +02:00
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
PermitRootLogin = "no";
};
hostKeys = mkIf (config.modules.impermanence.enable) [
{
type = "ed25519";
path = "/persist/system/etc/ssh/ssh_host_ed25519_key";
}
{
type = "rsa";
bits = 4096;
path = "/persist/system/etc/ssh/ssh_host_rsa_key";
}
];
};
2025-05-13 14:26:22 +02:00
};
}