aboutsummaryrefslogtreecommitdiff
path: root/home/profiles/ssh.nix
diff options
context:
space:
mode:
Diffstat (limited to 'home/profiles/ssh.nix')
-rw-r--r--home/profiles/ssh.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/home/profiles/ssh.nix b/home/profiles/ssh.nix
new file mode 100644
index 0000000..250aff5
--- /dev/null
+++ b/home/profiles/ssh.nix
@@ -0,0 +1,29 @@
+{ 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";
+ };
+}