aboutsummaryrefslogtreecommitdiff
path: root/homes/floppydisk/ssh.nix
blob: 99e77c58a9e330860b035f03a3acb273c58054f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
  nixosConfig,
  config,
  lib,
  ...
}: let
  _1passwordAgent = {
    enable = nixosConfig != {} && nixosConfig.programs._1password-gui.enable && nixosConfig.programs._1password-gui.sshAgent;
    path = "${config.home.homeDirectory}/.1password/agent.sock";
  };
in {
  programs.ssh = {
    enable = true;
    forwardAgent = _1passwordAgent.enable;
    extraConfig = lib.optionalString _1passwordAgent.enable "IdentityAgent ${_1passwordAgent.path}";
  };
}