dotfiles/modules/ssh.nix

39 lines
757 B
Nix
Raw Normal View History

2025-09-09 22:24:05 +02:00
{ config
, pkgs
, lib
, ...
2025-09-09 20:49:56 +02:00
}:
let
mkMatchBlock =
{ hostname }:
{
inherit hostname;
user = "lucy"; # Use dynamically retrieved user
identityFile = [
2025-09-09 22:10:22 +02:00
"/nix/persist/etc/ssh/id_ed25519"
2025-09-09 20:49:56 +02:00
];
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
'';
};
}