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

                  
                                
                   






                                                                             



                                

                                                 

                               
          
        

      




                                                                           
 
{ config, ... }:
{
  programs.ssh = {
    enable = true;
    enableDefaultConfig = false;
    matchBlocks = {
      "*" = {
        forwardAgent = true;
        serverAliveInterval = 60;
        controlPersist = "30m";
        controlPath = "${config.home.homeDirectory}/.ssh/sockets/S.%r@%h:%p";
        controlMaster = "auto";
      };
      "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";
  };
}