shared: cleaning up openssh client config

This commit is contained in:
2026-08-08 13:26:09 -04:00
parent 2be7c85e8d
commit 66e8925e4f
2 changed files with 30 additions and 30 deletions
-17
View File
@@ -1,17 +0,0 @@
Host thiccdata.io
Port 2222
User mbessette
HostName 192.168.1.45
Host germanium
Port 22
User mbessette
HostName 192.168.2.254
Host caesium
Port 22
User mbessette
HostName 192.168.2.136
Host *
IdentityAgent ~/.1password/agent.sock
+27 -10
View File
@@ -1,10 +1,9 @@
{
config,
lib,
pkgs,
hostname,
userConfig,
...
{ config
, lib
, pkgs
, hostname
, userConfig
, ...
}:
let
onePassPath =
@@ -34,7 +33,6 @@ in
xdg.cacheHome = "${config.home.homeDirectory}/.cache";
xdg.dataHome = "${config.home.homeDirectory}/.local/share";
xdg.stateHome = "${config.home.homeDirectory}/.config/state";
xdg.configFile."ssh.conf".source = ./config.ssh.conf;
xdg.configFile."1Password/ssh/agent.toml".text = ''
[[ssh-keys]]
item = "${userConfig._1PassKeyName}"
@@ -130,13 +128,32 @@ in
programs.ssh = {
enable = true;
enableDefaultConfig = false;
extraConfig = builtins.readFile ./config.ssh.conf;
settings = {
# Specific hosts are defined first
"thiccdata.io" = {
HostName = "192.168.1.45";
User = "mbessette";
Port = 2222;
ForwardAgent = true;
};
"germanium" = {
HostName = "192.168.2.254";
User = "mbessette";
};
"caesium" = {
HostName = "192.168.2.136";
User = "mbessette";
};
# Wildcard default settings defined last
"*" = {
ControlMaster = "auto";
ControlPath = "~/.ssh/master-%r@%h:%p";
ControlPersist = "10m";
IdentityAgent = "\"${onePassPath}\"";
IdentityAgent = onePassPath;
};
};
};