nixos/tsm-client: use `lib.concatLines`

Yarny0 ad2b7006 fca76c58

Changed files
+3 -3
nixos
modules
programs
+3 -3
nixos/modules/programs/tsm-client.nix
···
inherit (lib.attrsets) attrNames filterAttrs hasAttr mapAttrs mapAttrsToList optionalAttrs;
inherit (lib.modules) mkDefault mkIf;
inherit (lib.options) literalExpression mkEnableOption mkOption;
-
inherit (lib.strings) concatStringsSep optionalString toLower;
inherit (lib.types) addCheck attrsOf lines nonEmptyStr nullOr package path port str strMatching submodule;
# Checks if given list of strings contains unique
···
mkLine = k: v: k + optionalString (v!="") " ${v}";
lines = mapAttrsToList mkLine attrset;
in
-
concatStringsSep "\n" lines;
config.stanza = ''
server ${config.name}
${config.text}
···
${optionalString (cfg.defaultServername!=null) "defaultserver ${cfg.defaultServername}"}
-
${concatStringsSep "\n" (mapAttrsToList (k: v: v.stanza) cfg.servers)}
'';
in
···
inherit (lib.attrsets) attrNames filterAttrs hasAttr mapAttrs mapAttrsToList optionalAttrs;
inherit (lib.modules) mkDefault mkIf;
inherit (lib.options) literalExpression mkEnableOption mkOption;
+
inherit (lib.strings) concatLines optionalString toLower;
inherit (lib.types) addCheck attrsOf lines nonEmptyStr nullOr package path port str strMatching submodule;
# Checks if given list of strings contains unique
···
mkLine = k: v: k + optionalString (v!="") " ${v}";
lines = mapAttrsToList mkLine attrset;
in
+
concatLines lines;
config.stanza = ''
server ${config.name}
${config.text}
···
${optionalString (cfg.defaultServername!=null) "defaultserver ${cfg.defaultServername}"}
+
${concatLines (mapAttrsToList (k: v: v.stanza) cfg.servers)}
'';
in