From 03ceb367b77c88d99d31af840b15b06b1ee44428 Mon Sep 17 00:00:00 2001 From: "Emil \"AngryAnt\" Johansen" Date: Mon, 27 Mar 2023 15:46:32 +0200 Subject: [PATCH] lib.toPlist: support for path values --- lib/generators.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/generators.nix b/lib/generators.nix index 4357a0353398..72c66a0bc728 100644 --- a/lib/generators.nix +++ b/lib/generators.nix @@ -355,6 +355,7 @@ rec { # PLIST handling toPlist = {}: v: let isFloat = builtins.isFloat or (x: false); + isPath = x: builtins.typeOf x == "path"; expr = ind: x: with builtins; if x == null then "" else if isBool x then bool ind x else @@ -362,6 +363,7 @@ rec { if isString x then str ind x else if isList x then list ind x else if isAttrs x then attrs ind x else + if isPath x then str ind (toString x) else if isFloat x then float ind x else abort "generators.toPlist: should never happen (v = ${v})";