flakes/modules/nixos/core/sshd/default.nix
Chinmay D. Pai 3a3a8afe30
feat: add nixos configuration based on snowfall-lib
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2024-09-02 18:31:19 +05:30

23 lines
542 B
Nix

{ config, lib, ... }:
{
options.snowflake.core.sshd = {
enable = lib.mkEnableOption "Enable core sshd configuration";
};
config = lib.mkIf config.snowflake.core.sshd.enable {
services.openssh = {
enable = true;
settings = {
# Disable password auth and root login.
PasswordAuthentication = false;
PermitRootLogin = "no";
};
openFirewall = true;
};
# Enable mosh for access over spotty networks.
programs.mosh.enable = true;
programs.ssh.startAgent = true;
};
}