about summary refs log tree commit diff
path: root/home/ssh/default.nix
blob: eecca99897079955836b06cd9875e874b4a10447 (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
{ config, lib, ... }:
let cfg = config.my.home.ssh;
in
{
  options.my.home.ssh = with lib; {
    enable = mkEnableOption "ssh configuration";
  };

  config.programs.ssh = lib.mkIf cfg.enable {
    enable = true;
    forwardAgent = true;
    serverAliveInterval = 60;
    controlMaster = "auto";
    controlPersist = "30m";
    matchBlocks = {
      "github.com" = {
        hostname = "github.com";
        user = "git";
        forwardAgent = false;
        extraOptions = { preferredAuthentications = "publickey"; };
      };
    };
  };
}