summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--lib/default.nix2
-rw-r--r--lib/trivial.nix6
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/default.nix b/lib/default.nix
index 43b9ab5930c..44076d29517 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -66,7 +66,7 @@ let
       stringLength sub substring tail;
     inherit (trivial) id const pipe concat or and bitAnd bitOr bitXor
       bitNot boolToString mergeAttrs flip mapNullable inNixShell min max
-      importJSON warn info showWarnings nixpkgsVersion version mod compare
+      importJSON importTOML warn info showWarnings nixpkgsVersion version mod compare
       splitByAndCompare functionArgs setFunctionArgs isFunction toHexString toBaseDigits;
     inherit (fixedPoints) fix fix' converge extends composeExtensions
       makeExtensible makeExtensibleWithCustomName;
diff --git a/lib/trivial.nix b/lib/trivial.nix
index 9501a2906ca..268f39d3210 100644
--- a/lib/trivial.nix
+++ b/lib/trivial.nix
@@ -281,6 +281,12 @@ rec {
   importJSON = path:
     builtins.fromJSON (builtins.readFile path);
 
+  /* Reads a TOML file.
+
+     Type :: path -> any
+  */
+  importTOML = path:
+    builtins.fromTOML (builtins.readFile path);
 
   ## Warnings