aboutsummaryrefslogtreecommitdiff
path: root/users/programs/ssh.nix
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2025-07-26 11:01:53 -0700
committerFranck Cuny <franck@fcuny.net>2025-07-26 11:01:53 -0700
commit17e871833d66f7fc6a6fcab043e51b196f103855 (patch)
tree1bcb86bbee7fade4015745536aa6ae33804a99fe /users/programs/ssh.nix
parentfix alacritty configuration (diff)
downloadinfra-17e871833d66f7fc6a6fcab043e51b196f103855.tar.gz
moved every programs under users/programs
Configurations specific to work are managed in the work profile.
Diffstat (limited to 'users/programs/ssh.nix')
-rw-r--r--users/programs/ssh.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/users/programs/ssh.nix b/users/programs/ssh.nix
new file mode 100644
index 0000000..c236904
--- /dev/null
+++ b/users/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";
+ };
+}