From 3572f89bbe154087d8ad83c36674d0c2499c0967 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sat, 21 Jul 2018 12:26:53 +0200 Subject: [PATCH] ssh: don't add empty PubkeyAcceptedKeyTypes/HostKeyAlgorithms The options introduced in e2444a433fb would generate a broken ssh config when set to an empty list. /etc/ssh/ssh_config line 7: Missing argument. --- nixos/modules/programs/ssh.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/programs/ssh.nix b/nixos/modules/programs/ssh.nix index db44f9040dde..0f7f0515f0e9 100644 --- a/nixos/modules/programs/ssh.nix +++ b/nixos/modules/programs/ssh.nix @@ -211,8 +211,8 @@ in ForwardX11 ${if cfg.forwardX11 then "yes" else "no"} - PubkeyAcceptedKeyTypes ${concatStringsSep "," cfg.pubkeyAcceptedKeyTypes} - HostKeyAlgorithms ${concatStringsSep "," cfg.hostKeyAlgorithms} + ${optionalString (cfg.pubkeyAcceptedKeyTypes != []) PubkeyAcceptedKeyTypes "${concatStringsSep "," cfg.pubkeyAcceptedKeyTypes}"} + ${optionalString (cfg.hostKeyAlgorithms != []) HostKeyAlgorithms "${concatStringsSep "," cfg.hostKeyAlgorithms}"} ${cfg.extraConfig} '';