Files
nixos-configs/hosts/tadpole/modules/ssh/default.nix
2024-07-20 20:57:14 +02:00

38 lines
587 B
Nix

{ lib, config, ... }:
let
enabled = config.mod.ssh.enable;
in
{
options = {
mod.ssh = {
enable = lib.mkEnableOption "enable ssh module";
};
};
config = lib.mkIf enabled {
home-manager.users.alex = {
programs.ssh = {
enable = true;
};
};
services = {
openssh = {
enable = true;
ports = [ 1122 ];
hostKeys = [{
path = "/etc/ssh/tadpole";
type = "ed25519";
}];
};
};
networking = {
firewall = {
allowedTCPPorts = [ 1122 ];
};
};
};
}