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
|
||||||
config,
|
, lib
|
||||||
lib,
|
, pkgs
|
||||||
pkgs,
|
, hostname
|
||||||
hostname,
|
, userConfig
|
||||||
userConfig,
|
, ...
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
onePassPath =
|
onePassPath =
|
||||||
@@ -31,10 +30,9 @@ in
|
|||||||
|
|
||||||
xdg.enable = true;
|
xdg.enable = true;
|
||||||
xdg.configHome = "${config.home.homeDirectory}/.config";
|
xdg.configHome = "${config.home.homeDirectory}/.config";
|
||||||
xdg.cacheHome = "${config.home.homeDirectory}/.cache";
|
xdg.cacheHome = "${config.home.homeDirectory}/.cache";
|
||||||
xdg.dataHome = "${config.home.homeDirectory}/.local/share";
|
xdg.dataHome = "${config.home.homeDirectory}/.local/share";
|
||||||
xdg.stateHome = "${config.home.homeDirectory}/.config/state";
|
xdg.stateHome = "${config.home.homeDirectory}/.config/state";
|
||||||
xdg.configFile."ssh.conf".source = ./config.ssh.conf;
|
|
||||||
xdg.configFile."1Password/ssh/agent.toml".text = ''
|
xdg.configFile."1Password/ssh/agent.toml".text = ''
|
||||||
[[ssh-keys]]
|
[[ssh-keys]]
|
||||||
item = "${userConfig._1PassKeyName}"
|
item = "${userConfig._1PassKeyName}"
|
||||||
@@ -130,13 +128,32 @@ in
|
|||||||
programs.ssh = {
|
programs.ssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableDefaultConfig = false;
|
enableDefaultConfig = false;
|
||||||
extraConfig = builtins.readFile ./config.ssh.conf;
|
|
||||||
settings = {
|
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";
|
ControlMaster = "auto";
|
||||||
ControlPath = "~/.ssh/master-%r@%h:%p";
|
ControlPath = "~/.ssh/master-%r@%h:%p";
|
||||||
ControlPersist = "10m";
|
ControlPersist = "10m";
|
||||||
IdentityAgent = "\"${onePassPath}\"";
|
IdentityAgent = onePassPath;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user