From a4cb7c38cbdf32c610029ac42274a544f243ce79 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 6 Apr 2018 13:17:23 +0200 Subject: =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom/uucp.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'custom/uucp.nix') diff --git a/custom/uucp.nix b/custom/uucp.nix index 2a1fb401..59cfab59 100644 --- a/custom/uucp.nix +++ b/custom/uucp.nix @@ -3,12 +3,12 @@ with lib; let - portSpec = name: node: concatStringsSep "\n" (mapAttrsToList (portName: port: '' - port ${name}.${portName} + portSpec = name: node: concatStringsSep "\n" (map (port: '' + port ${name}.${port} type pipe protocol ${node.protocols} reliable true - command ${pkgs.openssh}/bin/ssh -x -o batchmode=yes ${name}.${portName} + command ${pkgs.openssh}/bin/ssh -x -o batchmode=yes ${name}.${port} '') node.hostnames); sysSpec = name: '' system ${name} @@ -16,12 +16,12 @@ let chat "" command-path ${concatStringsSep " " cfg.commandPath} commands ${concatStringsSep " " node.commands} - ${concatStringsSep "\nalternate\n" (mapAttrsToList (portName: port: '' - port ${name}.${portName} + ${concatStringsSep "\nalternate\n" (map (port: '' + port ${name}.${port} '') node.hostnames)} ''; - sshConfig = name: node: concatStringsSep "\n" (mapAttrsToList (portName: port: '' - Host ${name}.${portName} + sshConfig = name: node: concatStringsSep "\n" (map (port: '' + Host ${name}.${port} Hostname ${port} IdentitiesOnly Yes IdentityFile ${cfg.sshKeyDir}/${name}.pub @@ -62,9 +62,9 @@ let }; hostnames = mkOption { - type = types.attrsOf types.string; - default = {}; - description = ""; + type = types.listOf types.string; + default = []; + description = "Hostnames to try in order when connecting"; }; }; }; -- cgit v1.2.3