dotfiles/modules/ssh.nix
Lucy von Overheidt 1a4ef774e4 meow
2025-09-09 23:49:00 +02:00

35 lines
735 B
Nix

{ ...
}:
let
mkMatchBlock =
{ hostname }:
{
inherit hostname;
user = "lucy"; # Use dynamically retrieved user
identityFile = [
"/nix/persist/etc/ssh/id_ed25519"
];
port = 22;
};
in
{
# Enable SSH client in Home Manager
programs.ssh = {
enable = true;
# Define host-specific SSH configurations (match blocks)
matchBlocks = {
"shell.c-base.org" = mkMatchBlock { hostname = "shell.c-base.org"; };
"code.c-base.org" = mkMatchBlock { hostname = "code.c-base.org"; };
};
# Any extra SSH configuration options you want globally
extraConfig = ''
# Example of global settings
Compression yes
ServerAliveInterval 60
'';
};
}