mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 04:58:01 +00:00
bahaghari/lib: update importYAML
to be more correct
This commit is contained in:
parent
7159fc597f
commit
8f7e13734a
@ -14,14 +14,17 @@
|
||||
https://pkg.go.dev/gopkg.in/yaml.v3#readme-compatibility
|
||||
|
||||
Type: importYAML :: Path -> any
|
||||
|
||||
Example:
|
||||
importYAML ./simple.yml
|
||||
*/
|
||||
importYAML = path:
|
||||
let
|
||||
data = pkgs.runCommand "convert-yaml-to-json" { } ''
|
||||
${pkgs.lib.getExe' pkgs.yaml2json "yaml2json"} < ${path} > $out
|
||||
dataDrv = pkgs.runCommand "convert-yaml-to-json" { } ''
|
||||
${pkgs.lib.getExe' pkgs.yaml2json "yaml2json"} < "${path}" > "$out"
|
||||
'';
|
||||
in
|
||||
pkgs.lib.importJSON data;
|
||||
pkgs.lib.importJSON dataDrv.outPath;
|
||||
|
||||
/* Convert a given decimal number to a specified base digit with the set of
|
||||
glyphs for each digit as returned from lib.toBaseDigits.
|
||||
|
Loading…
Reference in New Issue
Block a user