diff options
author | zimbatm <zimbatm@zimbatm.com> | 2020-08-16 15:39:52 +0200 |
---|---|---|
committer | zimbatm <zimbatm@zimbatm.com> | 2020-09-12 16:37:50 +0200 |
commit | 947a7d33f997d8782ae74e2e76fb7645e86b663e (patch) | |
tree | 61badf7800f9a295abc32c21be2a13f2047155db /lib/trivial.nix | |
parent | 607509ac8f31794bdf9304eebf857d7137b60168 (diff) |
lib: add importTOML
Complements the `lib.importJSON`. `builtins.readTOML` has been introduced in Nix 2.1.
Diffstat (limited to 'lib/trivial.nix')
-rw-r--r-- | lib/trivial.nix | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/trivial.nix b/lib/trivial.nix index 9501a2906caee..268f39d321035 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 |