summaryrefslogtreecommitdiff
path: root/home/environ/ssh.nix
blob: 29829be7718cd69b68da8d42074e7a4fc0b52c91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{ config, lib, pkgs, ... }:
with lib; let
  cfg = config.local.environ;
in
{
  config = mkIf cfg.enable {
    programs.ssh = {
      enable = true;

      compression = true;
      controlMaster = "autoask";
      controlPath = "/run/user/%i/ssh/master-%r@%n:%p";

      extraOptionOverrides.AddKeysToAgent = "true";

      matchBlocks = import ./ssh-match.nix;
    };

    systemd.user.tmpfiles.rules = [
      "d %t/ssh 0700"
    ];
  };
}