From 66f4e5d9886bb7da3055c4f7615f9d093acda60b Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Tue, 28 Apr 2026 10:04:39 +0200 Subject: [PATCH 1/2] Revert "lib/strings.concatLines: call concatStringsSep directly" This reverts commit d7e6988c9b7bd7ada8662752ff654e4fde1a1426. --- lib/strings.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/strings.nix b/lib/strings.nix index d6170fdf39e3..848e61a65ddf 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -337,6 +337,7 @@ rec { /** Concatenate a list of strings, adding a newline at the end of each one. + Defined as `concatMapStrings (s: s + "\n")`. # Inputs @@ -360,7 +361,7 @@ rec { ::: */ - concatLines = str: concatStringsSep "\n" str + "\n"; + concatLines = concatMapStrings (s: s + "\n"); /** Given string `s`, replace every occurrence of the string `from` with the string `to`. From 5c9f6077a737e503bbbb04ab24ae79c0dcde278d Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Tue, 28 Apr 2026 10:08:32 +0200 Subject: [PATCH 2/2] lib/concatLines: add test for empty list --- lib/tests/misc.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix index 916994152754..f257d9953fc3 100644 --- a/lib/tests/misc.nix +++ b/lib/tests/misc.nix @@ -559,6 +559,10 @@ runTests { ]; expected = "a\nb\nc\n"; }; + testConcatLinesEmpty = { + expr = concatLines [ ]; + expected = ""; + }; testMakeIncludePathWithPkgs = { expr = (