lib: add importTOML
Complements the `lib.importJSON`. `builtins.readTOML` has been introduced in Nix 2.1.
This commit is contained in:
parent
607509ac8f
commit
947a7d33f9
|
@ -66,7 +66,7 @@ let
|
||||||
stringLength sub substring tail;
|
stringLength sub substring tail;
|
||||||
inherit (trivial) id const pipe concat or and bitAnd bitOr bitXor
|
inherit (trivial) id const pipe concat or and bitAnd bitOr bitXor
|
||||||
bitNot boolToString mergeAttrs flip mapNullable inNixShell min max
|
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;
|
splitByAndCompare functionArgs setFunctionArgs isFunction toHexString toBaseDigits;
|
||||||
inherit (fixedPoints) fix fix' converge extends composeExtensions
|
inherit (fixedPoints) fix fix' converge extends composeExtensions
|
||||||
makeExtensible makeExtensibleWithCustomName;
|
makeExtensible makeExtensibleWithCustomName;
|
||||||
|
|
|
@ -281,6 +281,12 @@ rec {
|
||||||
importJSON = path:
|
importJSON = path:
|
||||||
builtins.fromJSON (builtins.readFile path);
|
builtins.fromJSON (builtins.readFile path);
|
||||||
|
|
||||||
|
/* Reads a TOML file.
|
||||||
|
|
||||||
|
Type :: path -> any
|
||||||
|
*/
|
||||||
|
importTOML = path:
|
||||||
|
builtins.fromTOML (builtins.readFile path);
|
||||||
|
|
||||||
## Warnings
|
## Warnings
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue