aboutsummaryrefslogblamecommitdiff
path: root/home/profiles/ssh.nix
blob: 250aff54e7975b714423757d209ad3a8968bb8bc (plain) (tree)
1
2
3
4
5
6
7
8
9
                
 





                             
                                                                         

                   



                                

                                                 

                               
          
        

      




                                                                           
 
{ config, ... }:
{
  programs.ssh = {
    enable = true;
    forwardAgent = true;
    serverAliveInterval = 60;
    controlMaster = "auto";
    controlPersist = "30m";
    controlPath = "${config.home.homeDirectory}/.ssh/sockets/S.%r@%h:%p";

    matchBlocks = {
      "github.com" = {
        hostname = "github.com";
        user = "git";
        forwardAgent = false;
        extraOptions = {
          preferredAuthentications = "publickey";
          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";
  };
}