shared: cleaning up openssh client config
This commit is contained in:
@@ -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
|
||||
+30
-13
@@ -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;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user