My nix-darwin and NixOS config
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: SSH on macOS/Darwin

+17 -12
+17 -12
home/programs/ssh.nix
··· 30 30 }; 31 31 }; 32 32 }) internalHosts); 33 + 34 + # Global SSH options 35 + globalExtraOptions = { 36 + # Reuse connections for speed 37 + ControlMaster = "auto"; 38 + ControlPath = "~/.ssh/sockets/%r@%h-%p"; 39 + ControlPersist = "600"; 40 + 41 + # Automatically add keys to agent 42 + AddKeysToAgent = "yes"; 43 + }; 33 44 in 34 45 { 35 46 programs.ssh = { ··· 40 51 matchBlocks = tailscaleHostBlocks // { 41 52 # Global SSH configuration for all other hosts (git forges, etc.) 42 53 "*" = { 43 - extraOptions = { 44 - # Reuse connections for speed 45 - ControlMaster = "auto"; 46 - ControlPath = "~/.ssh/sockets/%r@%h-%p"; 47 - ControlPersist = "600"; 48 - 49 - # Automatically add keys to agent 50 - AddKeysToAgent = "yes"; 51 - } // lib.optionalAttrs isDarwin { 52 - # macOS: Use Keychain for SSH keys 53 - UseKeychain = "yes"; 54 - }; 54 + extraOptions = globalExtraOptions; 55 + } // lib.optionalAttrs isDarwin { 56 + # macOS: Use Keychain - must use raw config to preserve casing 57 + extraConfig = '' 58 + UseKeychain yes 59 + ''; 55 60 }; 56 61 }; 57 62 };