summaryrefslogtreecommitdiff
path: root/lib/ssh.nix
blob: 41c531cdddbad366e31a89bf532e3881b95021a9 (plain)
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
71
72
73
74
75
76
77
78
{ ... }:

let
  homedir = builtins.getEnv "HOME";
in {
  programs.ssh = {
    controlMaster = "auto";
    enable = true;
    forwardAgent = true;
    extraConfig = ''
      RemoteForward %d/.gnupg/S.gpg-agent ''${HOME}/.gnupg/S.gpg-agent.extra
    '';
    matchBlocks = {
      "github.com" = {
        hostname = "github.com";
        user = "git";
        identityFile = [ "${homedir}/.ssh/id_rsa" ];
        identitiesOnly = true;
      };

      # groq
      "bsima" = {
        hostname = "bsima"; # must be on vpn
        user = "bsima";
        identityFile = [ "${homedir}/.ssh/groq" ];
        identitiesOnly = true;
        forwardAgent = true;
        extraOptions = {
          #"RemoteCommand" = "tmux -CC new -As0";
          "RequestTTY" = "force";
        };
      };

      # simatime
      "sabten" = {
        hostname = "142.93.81.26";
        user = "root";
        identityFile = [ "${homedir}/.ssh/id_rsa" ];
        identitiesOnly = true;
      };
      "serval.simatime.com" = {
        hostname = "serval.simatime.com";
        user = "ben";
        identityFile = [ "${homedir}/.ssh/id_rsa" ];
        identitiesOnly = true;
      };
      "simatime.com" = {
        hostname = "simatime.com";
        user = "git";
        identityFile = [ "${homedir}/.ssh/id_rsa" ];
        identitiesOnly = true;
      };
      "gerrit.simatime.com" = {
        hostname = "gerrit.simatime.com";
        user = "bsima";
        identityFile = [ "${homedir}/.ssh/gerrit.simatime.com" ];
        identitiesOnly = true;
      };
      "lithium" = {
        hostname = "192.168.1.9";
        user = "ben";
        identityFile = [ "${homedir}/.ssh/id_rsa" ];
        identitiesOnly = true;
      };
      "dev.simatime.com" = {
        user = "ben";
        identityFile = [ "${homedir}/.ssh/id_rsa" ];
        identitiesOnly = true;
      };
      "git.platonic.systems" = {
        hostname = "git.platonic.systems";
        user = "git";
        identityFile = [ "${homedir}/.ssh/platonic.systems" ];
        identitiesOnly = true;
      };
    };
  };
}