32 lines
761 B
Nix
32 lines
761 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
confDir = "${config.home.homeDirectory}/nixos/files/conf/ssh";
|
|
sshClientConf = "${confDir}/ssh-client.conf";
|
|
in
|
|
{
|
|
programs.ssh = {
|
|
enable = true;
|
|
enableDefaultConfig = false;
|
|
|
|
matchBlocks."*" = {
|
|
addKeysToAgent = "yes";
|
|
serverAliveInterval = 30;
|
|
serverAliveCountMax = 3;
|
|
};
|
|
|
|
# Load your extra SSH config from a file in ~/nixos/files/conf/ssh/
|
|
extraConfig = ''
|
|
Include ${config.home.homeDirectory}/nixos/files/conf/ssh/ssh-client.conf
|
|
'';
|
|
};
|
|
|
|
# Home Manager's ssh-agent (NOT programs.ssh.startAgent; that's NixOS)
|
|
services.ssh-agent = {
|
|
enable = true;
|
|
|
|
# Optional: if you use zsh, this helps export SSH_AUTH_SOCK in your shell
|
|
enableZshIntegration = true;
|
|
};
|
|
}
|