NixOS and Home Manager config
1{ config, ... }: {
2 programs.ssh = {
3 enable = true;
4 enableDefaultConfig = false;
5 matchBlocks = {
6 "*" = {
7 forwardAgent = false;
8 addKeysToAgent = "yes";
9 compression = false;
10 serverAliveInterval = 0;
11 serverAliveCountMax = 3;
12 hashKnownHosts = false;
13 userKnownHostsFile = "~/.ssh/known_hosts";
14 controlMaster = "no";
15 controlPath = "~/.ssh/master-%r@%n:%p";
16 controlPersist = "no";
17 identityFile = "${config.home.homeDirectory}/.ssh/id_ed25519_login";
18 };
19 "nixos-shell" = {
20 hostname = "localhost";
21 port = 2222;
22 user = "git";
23 identityFile = "${config.home.homeDirectory}/.ssh/id_ed25519_git";
24 };
25 "git" = {
26 match = "User git";
27 identityFile = "${config.home.homeDirectory}/.ssh/id_ed25519_git";
28 };
29 };
30 };
31 services.ssh-agent.enable = true;
32}
33