From a4acc43150d3315d21578e3bfb7290fa2c34f1ac Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 28 Sep 2026 10:56:55 +0200 Subject: ... --- accounts/gkleen@skadhi/rzm/default.nix | 54 ++++++++++++++++------------------ 1 file changed, 25 insertions(+), 29 deletions(-) (limited to 'accounts/gkleen@skadhi/rzm/default.nix') diff --git a/accounts/gkleen@skadhi/rzm/default.nix b/accounts/gkleen@skadhi/rzm/default.nix index e2a47362..cea4a58a 100644 --- a/accounts/gkleen@skadhi/rzm/default.nix +++ b/accounts/gkleen@skadhi/rzm/default.nix @@ -176,51 +176,47 @@ in { pro = "$HOME/projects/pro"; }; - programs.ssh.matchBlocks = let - autosshProxy = host: "${lib.getExe pkgs.socat} - SOCKS4A:127.0.0.1:%h:%p,socksport=${toString config.services.autosshProxy.${host}.port}"; - in { + programs.ssh.settings = { "repo-apt01" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { - user = "root"; - hostname = "repo-apt01.mathinst.loc"; - proxyCommand = autosshProxy "mgmt01"; + User = "root"; + Hostname = "repo-apt01.mathinst.loc"; + inherit (config.programs.ssh.autosshProxies."mgmt01") ProxyCommand; }; "mgmt01" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { - user = "root"; - hostname = "mgmt01.mathinst.loc"; - proxyCommand = autosshProxy "mathw0h"; + User = "root"; + Hostname = "mgmt01.mathinst.loc"; + inherit (config.programs.ssh.autosshProxies."mathw0h") ProxyCommand; }; "mathw0e" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { - hostname = "mathw0e.mathinst.loc"; - proxyCommand = autosshProxy "mathw0h"; + Hostname = "mathw0e.mathinst.loc"; + inherit (config.programs.ssh.autosshProxies."mathw0h") ProxyCommand; }; "cip04" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { - hostname = "cip04.cipmath.loc"; - proxyCommand = autosshProxy "mathw0h"; + Hostname = "cip04.cipmath.loc"; + inherit (config.programs.ssh.autosshProxies."mathw0h") ProxyCommand; }; "mathw0h" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { - hostname = "mathw0h.mathinst.loc"; - proxyCommand = autosshProxy "ssh.math.lmu.de"; + Hostname = "mathw0h.mathinst.loc"; + inherit (config.programs.ssh.autosshProxies."ssh.math.lmu.de") ProxyCommand; }; "math05" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { - hostname = "math05.mathinst.loc"; - proxyCommand = autosshProxy "mathw0h"; - extraOptions.KexAlgorithms = "+diffie-hellman-group1-sha1"; + Hostname = "math05.mathinst.loc"; + inherit (config.programs.ssh.autosshProxies."mathw0h") ProxyCommand; + KexAlgorithms = "+diffie-hellman-group1-sha1"; }; "*.mathinst.loc" = { - match = "host *.mathinst.loc,*.cipmath.loc,*.math.lmu.de"; - identityFile = "~/.ssh/gkleen@mathinst.loc"; - extraOptions = { - HostKeyAlgorithms = "+ssh-rsa"; - PubkeyAcceptedAlgorithms = "+ssh-rsa"; - PasswordAuthentication = "yes"; - GlobalKnownHostsFile = toString (pkgs.writeText "ssh_known_hosts" '' - @cert-authority *.mathinst.loc,*.math.lmu.de,*.cipmath.loc ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBUTFpVCdETCXiDSDl7YGbR1J4BLTsoBzjDtflHJGO/z ssh-pki@mgmt01 - ''); - }; + header = "Host *.mathinst.loc,*.cipmath.loc,*.math.lmu.de"; + IdentityFile = "~/.ssh/gkleen@mathinst.loc"; + HostKeyAlgorithms = "+ssh-rsa"; + PubkeyAcceptedAlgorithms = "+ssh-rsa"; + PasswordAuthentication = "yes"; + GlobalKnownHostsFile = toString (pkgs.writeText "ssh_known_hosts" '' + @cert-authority *.mathinst.loc,*.math.lmu.de,*.cipmath.loc ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBUTFpVCdETCXiDSDl7YGbR1J4BLTsoBzjDtflHJGO/z ssh-pki@mgmt01 + ''); }; }; - services.autosshProxy = { + programs.ssh.autosshProxies = { "mgmt01" = { port = 8129; sshpassSecret = "root@mgmt01.mathinst.loc"; }; "mathw0e" = { port = 8125; sshpassSecret = "gkleen@mathw0e.mathinst.loc"; }; "mathw0h" = { port = 8123; sshpassSecret = "gkleen@mathw0h.mathinst.loc"; }; -- cgit v1.2.3