Files
nix-config-ryan4yin/home/base/tui/ssh.nix
T

44 lines
985 B
Nix

{
config,
mysecrets,
...
}:
{
home.file.".ssh/romantic.pub".source = "${mysecrets}/public/romantic.pub";
programs.ssh = {
enable = true;
enableDefaultConfig = false;
settings."*" = {
ForwardAgent = false;
AddKeysToAgent = "yes";
Compression = true;
ServerAliveInterval = 0;
ServerAliveCountMax = 3;
HashKnownHosts = false;
UserKnownHostsFile = "~/.ssh/known_hosts";
ControlMaster = "no";
ControlPath = "~/.ssh/master-%r@%n:%p";
ControlPersist = "no";
};
settings = {
"github.com" = {
# avoid clash fake-IP6 hang, see modules/nixos/desktop/networking/clash-verge.nix
AddressFamily = "inet";
HostName = "ssh.github.com";
Port = 443;
User = "git";
IdentitiesOnly = true;
};
"192.168.*" = {
ForwardAgent = true;
IdentityFile = "/etc/agenix/ssh-key-romantic";
IdentitiesOnly = true;
};
};
};
}