From 6c91bbe714e08146e2aaacf0a6b8938c508da238 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Mon, 9 Nov 2020 00:21:32 +0000 Subject: [PATCH] hm: set up ssh --- ops/nixos/lib/home-manager/client.nix | 2 ++ ops/nixos/lib/home-manager/common.nix | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ops/nixos/lib/home-manager/client.nix b/ops/nixos/lib/home-manager/client.nix index d7a74a2eb9..0f96b83e9a 100644 --- a/ops/nixos/lib/home-manager/client.nix +++ b/ops/nixos/lib/home-manager/client.nix @@ -27,6 +27,8 @@ set mouse= ''; }; + programs.ssh.controlMaster = "auto"; + programs.ssh.controlPersist = "10m"; programs.bash.initExtra = lib.mkAfter '' ssh-add -q -l >/dev/null || ssh-add -c -q diff --git a/ops/nixos/lib/home-manager/common.nix b/ops/nixos/lib/home-manager/common.nix index 63f750b85b..295b773549 100644 --- a/ops/nixos/lib/home-manager/common.nix +++ b/ops/nixos/lib/home-manager/common.nix @@ -1,4 +1,4 @@ -{ depot, pkgs, ... }: +{ depot, lib, pkgs, ... }: { programs.home-manager.enable = true; @@ -12,6 +12,24 @@ VISUAL = "vim"; }; + programs.ssh = { + enable = true; + forwardAgent = true; + matchBlocks = let + allEventBlocks = (lib.concatStringsSep " " (builtins.map (n: "172.${toString n}.*.*") (lib.range 16 31))); + in ({ + marukuru.port = 20022; + sar1.hostname = "81.131.50.219"; + sar1-mon1 = { + user = "eng"; + hostname = "172.16.0.9"; + proxyJump = "sar1"; + }; + } // (builtins.listToAttrs [ + { name = allEventBlocks; value = { proxyJump = "sar1"; }; } + ])); + }; + programs.bash = { enable = true; enableVteIntegration = true;