diff options
Diffstat (limited to 'modules/tools/openssh/default.nix')
| -rw-r--r-- | modules/tools/openssh/default.nix | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/modules/tools/openssh/default.nix b/modules/tools/openssh/default.nix new file mode 100644 index 0000000..f97ff45 --- /dev/null +++ b/modules/tools/openssh/default.nix @@ -0,0 +1,39 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + options.tools.openssh = { + enable = lib.mkEnableOption "Enables OpenSSH client."; + }; + + config = lib.mkIf config.tools.openssh.enable { + programs.ssh = { + enable = true; + package = pkgs.openssh; + enableDefaultConfig = false; + extraOptionOverrides = { + AddKeysToAgent = "yes"; + ForwardAgent = "yes"; + ServerAliveInterval = "60"; + ServerAliveCountMax = "3"; + VisualHostKey = "yes"; + HashKnownHosts = "yes"; + }; + matchBlocks = { + "github.com" = { + hostname = "github.com"; + user = "git"; + identityFile = "${config.home.homeDirectory}/.ssh/github"; + }; + }; + }; + + home.file.".ssh/config".text = '' + Include ~/.ssh/config.d/*.conf + ''; + }; +} |
