aboutsummaryrefslogblamecommitdiff
path: root/home/ssh/default.nix
blob: eecca99897079955836b06cd9875e874b4a10447 (plain) (tree)
1
2
3
4
5

                             

  
                                   


















                                                                   
{ 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"; };
      };
    };
  };
}