summaryrefslogtreecommitdiffstats
path: root/configs/ssh.nix
blob: 0dda6e5d81885d299ed38f4dadf545ded07fb7eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{ config, lib, pkgs, ... }: {
  # Override NixOS's "Allow DSA keys for now."
  environment.etc."ssh/ssh_config".text = lib.mkForce ''
    AddressFamily ${if config.networking.enableIPv6 then "any" else "inet"}

    ${lib.optionalString config.programs.ssh.setXAuthLocation ''
      XAuthLocation ${pkgs.xorg.xauth}/bin/xauth
    ''}

    ForwardX11 ${if config.programs.ssh.forwardX11 then "yes" else "no"}

    ${config.programs.ssh.extraConfig}
  '';

  programs.ssh = {
    extraConfig = ''
      UseRoaming no
    '';
    startAgent = false;
  };
}