diff options
| author | Franck Cuny <franck@fcuny.net> | 2025-08-12 08:52:51 -0700 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2025-08-12 08:52:51 -0700 |
| commit | 61fa2329f553f9c7962e968e1ec98ae675903b70 (patch) | |
| tree | 0afdbf7c8fddda1718abee49db6206a5f8df5b09 /home/programs/ssh.nix | |
| parent | directories first (diff) | |
| download | infra-61fa2329f553f9c7962e968e1ec98ae675903b70.tar.gz | |
users -> home
Diffstat (limited to 'home/programs/ssh.nix')
| -rw-r--r-- | home/programs/ssh.nix | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/home/programs/ssh.nix b/home/programs/ssh.nix new file mode 100644 index 0000000..c236904 --- /dev/null +++ b/home/programs/ssh.nix @@ -0,0 +1,33 @@ +{ pkgs, config, ... }: +{ + # https://github.com/nix-community/home-manager/blob/master/modules/programs/ssh.nix + programs.ssh = { + enable = true; + forwardAgent = true; + serverAliveInterval = 60; + controlMaster = "auto"; + controlPersist = "30m"; + controlPath = "${config.home.homeDirectory}/.ssh/sockets/S.%r@%h:%p"; + + matchBlocks = { + "git.fcuny.net" = { + proxyCommand = "${pkgs.cloudflared}/bin/cloudflared access ssh --hostname %h"; + }; + "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"; + }; +} |
