summaryrefslogtreecommitdiffstats
path: root/lib/generators.nix
diff options
context:
space:
mode:
authorMatthieu Coudron <886074+teto@users.noreply.github.com>2023-12-14 22:41:50 +0100
committerMatthieu Coudron <886074+teto@users.noreply.github.com>2023-12-15 15:05:46 +0100
commit4ea6c0c58bea95f22fbca81ae5edddc93b342b5e (patch)
tree69d629f275df0ff1b91505b38b501286a9beeae1 /lib/generators.nix
parentd4af6e420f92351da65e6726fe7246adc9e1d498 (diff)
lib.generators: made toLua accept derivations too
While trying to extend generateLuarocksConfig, I had infinite loops caused by toLua considering derivations as attrSets
Diffstat (limited to 'lib/generators.nix')
-rw-r--r--lib/generators.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/generators.nix b/lib/generators.nix
index 8e93ed04916e..ed59654cc07e 100644
--- a/lib/generators.nix
+++ b/lib/generators.nix
@@ -525,6 +525,8 @@ ${expr "" v}
"(${v.expr})"
else if v == { } then
"{}"
+ else if libAttr.isDerivation v then
+ ''"${toString v}"''
else
"{${introSpace}${concatItems (
lib.attrsets.mapAttrsToList (key: value: "[${builtins.toJSON key}] = ${toLua innerArgs value}") v