lib.generators.toINI: serialize derivations to string

This is the common case when passing a derivation, we want to access the
store path.
This commit is contained in:
zimbatm 2021-09-12 06:23:30 +02:00
parent 9e90a400a5
commit f882fbcee0
No known key found for this signature in database
GPG Key ID: 71BAF6D40C1D63D7

View File

@ -35,6 +35,8 @@ rec {
("generators.mkValueStringDefault: " + ("generators.mkValueStringDefault: " +
"${t} not supported: ${toPretty {} v}"); "${t} not supported: ${toPretty {} v}");
in if isInt v then toString v in if isInt v then toString v
# convert derivations to store paths
else if lib.isDerivation v then toString v
# we default to not quoting strings # we default to not quoting strings
else if isString v then v else if isString v then v
# isString returns "1", which is not a good default # isString returns "1", which is not a good default