Skip to content

Commit 07793fb

Browse files
authored
Merge pull request #121 from DeterminateSystems/fix-string-list-handling
Fix string list handling in custom configuration
2 parents 909d38c + b720ed4 commit 07793fb

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

modules/nix-darwin/config/config.nix

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,20 @@ let
1919
builtins.toString v
2020
else if builtins.isFloat v then
2121
lib.strings.floatToString v
22+
# Convert lists of strings like `["foo" "bar"]` into space-separated strings like `foo bar`
2223
else if builtins.isList v then
23-
builtins.toJSON v
24+
let
25+
ensureStrings =
26+
ls:
27+
lib.forEach ls (
28+
item:
29+
if builtins.isString item then
30+
item
31+
else
32+
throw "Expected all list items to be strings but got ${builtins.typeOf item} instead"
33+
);
34+
in
35+
lib.concatStringsSep " " (ensureStrings v)
2436
else if lib.isDerivation v then
2537
builtins.toString v
2638
else if builtins.isPath v then

0 commit comments

Comments
 (0)