aboutsummaryrefslogtreecommitdiff
path: root/home/programs/ssh.nix
blob: b7a57965835f9799220dfed3edfaf951943c13b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
  config,
  lib,
  pkgs,
  ...
}:
{
  programs.ssh = {
    enable = true;
    enableDefaultConfig = false;
    matchBlocks = {
      "*.coder" = {
        proxyCommand = "${lib.getExe pkgs.coder-mainline} --global-config \"/Users/fcuny/Library/Application Support/coderv2\" ssh --stdio %h";
        extraOptions = {
          "ConnectTimeout" = "0";
          "StrictHostKeyChecking" = "no";
          "UserKnownHostsFile" = "/dev/null";
          "LogLevel" = "ERROR";
          # Disable ControlMaster for Coder to avoid "stuck" tunnels if a workspace restarts.
          "ControlMaster" = "no";
          "ControlPath" = "none";
        };
      };
      "*" = {
        controlMaster = "auto";
        controlPath = "${config.home.homeDirectory}/.ssh/sockets/S.%r@%h:%p";
        controlPersist = "30m";
        forwardAgent = false;
        identitiesOnly = true;
        identityAgent = "none";
        identityFile = "${config.home.homeDirectory}/.ssh/id_ed25519_sk_rk";
        serverAliveInterval = 60;
      };
      "riv" = {
        hostname = "192.168.1.114";
      };
      "riv-unlock" = {
        hostname = "192.168.1.114";
        user = "root";
        port = 911;
      };
      "nas" = {
        hostname = "192.168.1.68";
      };
      "nnas" = {
        hostname = "192.168.1.68";
        user = "nas";
      };
      "bree" = {
        hostname = "192.168.1.50";
      };
      "argonath" = {
        hostname = "fcuny.net";
      };
      "github.com" = {
        hostname = "github.com";
        user = "git";
        extraOptions = {
          controlMaster = "no";
          controlPath = "none";
        };
      };
    };
  };

  home.file = {
    # we need this path to be created so that the control path can be used.
    ".ssh/sockets/.keep".text = "# Managed by Home Manager";
  };
}