From ca20a96b5ff3318eb136c93b44d4996e2a88fb61 Mon Sep 17 00:00:00 2001 From: polykernel <81340136+polykernel@users.noreply.github.com> Date: Sat, 28 Aug 2021 11:18:03 -0400 Subject: [PATCH] treewide: concatStrings (intersperse ...) -> concatStringsSep ... Update all usage of lib.concatStrings (lib.intersperse ...) to lib.concatStringsSep. This produces the same result as per https://github.com/NixOS/nixpkgs/pull/135843, however it yields a performance benefit on Nix versions that support the builtins.concatStringsSep primop. --- pkgs/applications/misc/keepass/default.nix | 2 +- pkgs/applications/video/vdr/wrapper.nix | 2 +- pkgs/desktops/xfce/core/thunar/wrapper.nix | 2 +- pkgs/development/compilers/gcc/common/configure-flags.nix | 3 +-- pkgs/misc/emulators/retroarch/wrapper.nix | 2 +- pkgs/tools/graphics/diagrams-builder/default.nix | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/misc/keepass/default.nix b/pkgs/applications/misc/keepass/default.nix index 336bd5a7f64d..f2846de37d3f 100644 --- a/pkgs/applications/misc/keepass/default.nix +++ b/pkgs/applications/misc/keepass/default.nix @@ -84,7 +84,7 @@ with builtins; buildDotnetPackage rec { # after loading. It is brought into plugins bin/ directory using # buildEnv in the plugin derivation. Wrapper below makes sure it # is found and does not pollute output path. - binPaths = lib.concatStrings (lib.intersperse ":" (map (x: x + "/bin") plugins)); + binPaths = lib.concatStringsSep ":" (map (x: x + "/bin") plugins); dynlibPath = lib.makeLibraryPath [ gtk2 ]; diff --git a/pkgs/applications/video/vdr/wrapper.nix b/pkgs/applications/video/vdr/wrapper.nix index 50d3b9d65a8d..04984212b249 100644 --- a/pkgs/applications/video/vdr/wrapper.nix +++ b/pkgs/applications/video/vdr/wrapper.nix @@ -24,7 +24,7 @@ in symlinkJoin { inherit license homepage; description = description + " (with plugins: " - + lib.concatStrings (lib.intersperse ", " (map (x: ""+x.name) plugins)) + + lib.concatStringsSep ", " (map (x: ""+x.name) plugins) + ")"; }; } diff --git a/pkgs/desktops/xfce/core/thunar/wrapper.nix b/pkgs/desktops/xfce/core/thunar/wrapper.nix index 4e9732ce1c4a..5381dceae4a4 100644 --- a/pkgs/desktops/xfce/core/thunar/wrapper.nix +++ b/pkgs/desktops/xfce/core/thunar/wrapper.nix @@ -36,6 +36,6 @@ symlinkJoin { description = thunar.meta.description + optionalString (0 != length thunarPlugins) - " (with plugins: ${concatStrings (intersperse ", " (map (x: x.name) thunarPlugins))})"; + " (with plugins: ${concatStringsSep ", " (map (x: x.name) thunarPlugins)})"; }; } diff --git a/pkgs/development/compilers/gcc/common/configure-flags.nix b/pkgs/development/compilers/gcc/common/configure-flags.nix index 4686a387712f..6744ad8b0bfe 100644 --- a/pkgs/development/compilers/gcc/common/configure-flags.nix +++ b/pkgs/development/compilers/gcc/common/configure-flags.nix @@ -133,7 +133,7 @@ let "--with-system-zlib" "--enable-static" "--enable-languages=${ - lib.concatStrings (lib.intersperse "," + lib.concatStringsSep "," ( lib.optional langC "c" ++ lib.optional langCC "c++" ++ lib.optional langD "d" @@ -146,7 +146,6 @@ let ++ lib.optionals crossDarwin [ "objc" "obj-c++" ] ++ lib.optional langJit "jit" ) - ) }" ] diff --git a/pkgs/misc/emulators/retroarch/wrapper.nix b/pkgs/misc/emulators/retroarch/wrapper.nix index 40d9f07846b7..4cc7ad404be0 100644 --- a/pkgs/misc/emulators/retroarch/wrapper.nix +++ b/pkgs/misc/emulators/retroarch/wrapper.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation { inherit license homepage platforms maintainers; description = description + " (with cores: " - + lib.concatStrings (lib.intersperse ", " (map (x: ""+x.name) cores)) + + lib.concatStringsSep ", " (map (x: ""+x.name) cores) + ")"; }; } diff --git a/pkgs/tools/graphics/diagrams-builder/default.nix b/pkgs/tools/graphics/diagrams-builder/default.nix index 9337d5cca23b..85f4fdc83efa 100644 --- a/pkgs/tools/graphics/diagrams-builder/default.nix +++ b/pkgs/tools/graphics/diagrams-builder/default.nix @@ -36,7 +36,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ makeWrapper ]; buildCommand = with lib; - concatStrings (intersperse "\n" (map exeWrapper backends)); + concatStringsSep "\n" (map exeWrapper backends); # Will be faster to build the wrapper locally then to fetch it from a binary cache. preferLocalBuild = true;