mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
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;
|
||||
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;
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user