diff options
Diffstat (limited to 'accounts/gkleen@skadhi/rzm/default.nix')
| -rw-r--r-- | accounts/gkleen@skadhi/rzm/default.nix | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/accounts/gkleen@skadhi/rzm/default.nix b/accounts/gkleen@skadhi/rzm/default.nix index 11d8af8b..e2a47362 100644 --- a/accounts/gkleen@skadhi/rzm/default.nix +++ b/accounts/gkleen@skadhi/rzm/default.nix | |||
| @@ -97,7 +97,7 @@ in { | |||
| 97 | ''; | 97 | ''; |
| 98 | }; | 98 | }; |
| 99 | 99 | ||
| 100 | home-manager.users.gkleen = { sysConfig, config, ... }: { | 100 | home-manager.users.gkleen = { sysConfig, config, lib, ... }: { |
| 101 | home.persistence."/persistent" = { | 101 | home.persistence."/persistent" = { |
| 102 | files = [ | 102 | files = [ |
| 103 | "rz.kdbx" | 103 | "rz.kdbx" |
| @@ -176,7 +176,36 @@ in { | |||
| 176 | pro = "$HOME/projects/pro"; | 176 | pro = "$HOME/projects/pro"; |
| 177 | }; | 177 | }; |
| 178 | 178 | ||
| 179 | programs.ssh.matchBlocks = { | 179 | programs.ssh.matchBlocks = let |
| 180 | autosshProxy = host: "${lib.getExe pkgs.socat} - SOCKS4A:127.0.0.1:%h:%p,socksport=${toString config.services.autosshProxy.${host}.port}"; | ||
| 181 | in { | ||
| 182 | "repo-apt01" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { | ||
| 183 | user = "root"; | ||
| 184 | hostname = "repo-apt01.mathinst.loc"; | ||
| 185 | proxyCommand = autosshProxy "mgmt01"; | ||
| 186 | }; | ||
| 187 | "mgmt01" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { | ||
| 188 | user = "root"; | ||
| 189 | hostname = "mgmt01.mathinst.loc"; | ||
| 190 | proxyCommand = autosshProxy "mathw0h"; | ||
| 191 | }; | ||
| 192 | "mathw0e" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { | ||
| 193 | hostname = "mathw0e.mathinst.loc"; | ||
| 194 | proxyCommand = autosshProxy "mathw0h"; | ||
| 195 | }; | ||
| 196 | "cip04" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { | ||
| 197 | hostname = "cip04.cipmath.loc"; | ||
| 198 | proxyCommand = autosshProxy "mathw0h"; | ||
| 199 | }; | ||
| 200 | "mathw0h" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { | ||
| 201 | hostname = "mathw0h.mathinst.loc"; | ||
| 202 | proxyCommand = autosshProxy "ssh.math.lmu.de"; | ||
| 203 | }; | ||
| 204 | "math05" = lib.hm.dag.entryBefore ["*.mathinst.loc"] { | ||
| 205 | hostname = "math05.mathinst.loc"; | ||
| 206 | proxyCommand = autosshProxy "mathw0h"; | ||
| 207 | extraOptions.KexAlgorithms = "+diffie-hellman-group1-sha1"; | ||
| 208 | }; | ||
| 180 | "*.mathinst.loc" = { | 209 | "*.mathinst.loc" = { |
| 181 | match = "host *.mathinst.loc,*.cipmath.loc,*.math.lmu.de"; | 210 | match = "host *.mathinst.loc,*.cipmath.loc,*.math.lmu.de"; |
| 182 | identityFile = "~/.ssh/gkleen@mathinst.loc"; | 211 | identityFile = "~/.ssh/gkleen@mathinst.loc"; |
| @@ -191,6 +220,14 @@ in { | |||
| 191 | }; | 220 | }; |
| 192 | }; | 221 | }; |
| 193 | 222 | ||
| 223 | services.autosshProxy = { | ||
| 224 | "mgmt01" = { port = 8129; sshpassSecret = "root@mgmt01.mathinst.loc"; }; | ||
| 225 | "mathw0e" = { port = 8125; sshpassSecret = "gkleen@mathw0e.mathinst.loc"; }; | ||
| 226 | "mathw0h" = { port = 8123; sshpassSecret = "gkleen@mathw0h.mathinst.loc"; }; | ||
| 227 | "cip04" = { port = 8127; sshpassSecret = "gkleen@cip04.cipmath.loc"; }; | ||
| 228 | "ssh.math.lmu.de" = { port = 8119; sshpassSecret = "gkleen@ssh.math.lmu.de"; }; | ||
| 229 | }; | ||
| 230 | |||
| 194 | home.file = { | 231 | home.file = { |
| 195 | ".cups/client.conf".text = '' | 232 | ".cups/client.conf".text = '' |
| 196 | ServerName cups.mathinst.loc | 233 | ServerName cups.mathinst.loc |
