Skip to content

Commit

Permalink
ssh: add addKeysToAgent option
Browse files Browse the repository at this point in the history
  • Loading branch information
lockejan committed Dec 15, 2022
1 parent e412025 commit a2e5d4d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions modules/programs/ssh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,16 @@ in
'';
};

addKeysToAgent = mkOption {
type = types.enum [ "yes" "no" "ask" "confirm" ];
default = "no";
description = ''
When enabled, a private key that is used during authentication will be
added to ssh-agent if it is running (with confirmation enabled if
set to 'confirm').
'';
};

compression = mkOption {
default = false;
type = types.bool;
Expand Down Expand Up @@ -537,6 +547,7 @@ in
ControlMaster ${cfg.controlMaster}
ControlPath ${cfg.controlPath}
ControlPersist ${cfg.controlPersist}
AddKeysToAgent ${cfg.addKeysToAgent}
${replaceStrings ["\n"] ["\n "] cfg.extraConfig}
'';
Expand Down
1 change: 1 addition & 0 deletions tests/modules/programs/ssh/default-config-expected.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ Host *
ControlMaster no
ControlPath ~/.ssh/master-%r@%n:%p
ControlPersist no
AddKeysToAgent no


0 comments on commit a2e5d4d

Please sign in to comment.