From 5e43294735d2abe036eef0a8922bfe67bac65929 Mon Sep 17 00:00:00 2001 From: Marie Ramlow Date: Sun, 24 Nov 2024 19:02:59 +0100 Subject: [PATCH] nixos/ssh: include systemd-ssh-proxy config --- nixos/modules/programs/ssh.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nixos/modules/programs/ssh.nix b/nixos/modules/programs/ssh.nix index fbc59c09a68f..0faf14fd4c29 100644 --- a/nixos/modules/programs/ssh.nix +++ b/nixos/modules/programs/ssh.nix @@ -49,6 +49,15 @@ in description = "Whether to configure SSH_ASKPASS in the environment."; }; + systemd-ssh-proxy.enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Whether to enable systemd's ssh proxy plugin. + See {manpage}`systemd-ssh-proxy(1)`. + ''; + }; + askPassword = lib.mkOption { type = lib.types.str; default = "${pkgs.x11_ssh_askpass}/libexec/x11-ssh-askpass"; @@ -332,6 +341,11 @@ in # Custom options from `extraConfig`, to override generated options ${cfg.extraConfig} + ${lib.optionalString cfg.systemd-ssh-proxy.enable '' + # See systemd-ssh-proxy(1) + Include ${config.systemd.package}/lib/systemd/ssh_config.d/20-systemd-ssh-proxy.conf + ''} + # Generated options from other settings Host * GlobalKnownHostsFile ${builtins.concatStringsSep " " knownHostsFiles}