about summary refs log tree commit diff
path: root/lib/generators.nix
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2023-05-05 21:15:23 +0200
committerGitHub <noreply@github.com>2023-05-05 21:15:23 +0200
commite31c8b22ddb121f8840e2c94fa25557b572e3bb5 (patch)
treebcb7505eec51480dfee58ae2a54203bd6954a969 /lib/generators.nix
parent7d76bc7e818a419282c6502993864eb2ae8e07a1 (diff)
parente932e98437ea9184365233bad439860c795f65a1 (diff)
Merge pull request #223407 from AngryAnt/toplist-path
lib.toPlist: Add support for path values
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 c46ecca58c68f..aace53e2f7509 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})";