From 8f7e13734a14b3d1877c64afed56caf47cf7315d Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 24 Feb 2024 18:52:19 +0800 Subject: [PATCH] bahaghari/lib: update `importYAML` to be more correct --- subprojects/bahaghari/lib/trivial.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/subprojects/bahaghari/lib/trivial.nix b/subprojects/bahaghari/lib/trivial.nix index 64a3a683..19167fc6 100644 --- a/subprojects/bahaghari/lib/trivial.nix +++ b/subprojects/bahaghari/lib/trivial.nix @@ -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.