From 66e8925e4f782b9f018df48dd18693ea3fa4f47b Mon Sep 17 00:00:00 2001 From: Matthew Bessette Date: Sat, 8 Aug 2026 13:26:09 -0400 Subject: [PATCH] shared: cleaning up openssh client config --- config.ssh.conf | 17 ----------------- home.shared.nix | 43 ++++++++++++++++++++++++++++++------------- 2 files changed, 30 insertions(+), 30 deletions(-) delete mode 100644 config.ssh.conf diff --git a/config.ssh.conf b/config.ssh.conf deleted file mode 100644 index dff9a70..0000000 --- a/config.ssh.conf +++ /dev/null @@ -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 diff --git a/home.shared.nix b/home.shared.nix index 858fa3a..549ad91 100644 --- a/home.shared.nix +++ b/home.shared.nix @@ -1,10 +1,9 @@ -{ - config, - lib, - pkgs, - hostname, - userConfig, - ... +{ config +, lib +, pkgs +, hostname +, userConfig +, ... }: let onePassPath = @@ -31,10 +30,9 @@ in xdg.enable = true; xdg.configHome = "${config.home.homeDirectory}/.config"; - 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.cacheHome = "${config.home.homeDirectory}/.cache"; + xdg.dataHome = "${config.home.homeDirectory}/.local/share"; + xdg.stateHome = "${config.home.homeDirectory}/.config/state"; 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; }; }; };