rename fromYAML -> importYAML

this is more consistent with existing nixpkgs.lib functions
This commit is contained in:
Elec3137 2026-02-01 14:13:29 -08:00
commit 3687287cf0

View file

@ -33,15 +33,13 @@
src = ./.;
# from https://discourse.nixos.org/t/is-there-a-way-to-read-a-yaml-file-and-get-back-a-set/18385/5
fromYAML =
importYAML =
file:
builtins.fromJSON (
builtins.readFile (
pkgs.runCommand "converted-yaml.json" { } ''${pkgs.yj}/bin/yj < "${file}" > "$out"''
)
lib.importJSON (
pkgs.runCommand "converted-yaml.json" { } ''${pkgs.yj}/bin/yj < "${file}" > "$out"''
);
package = fromYAML "${src}/pubspec.yaml";
package = importYAML "${src}/pubspec.yaml";
in
{
_module.args.pkgs = import nixpkgs {
@ -59,6 +57,7 @@
olm
git
clang
pkg-config
(flutter.override { extraPkgConfigPackages = [ pkgs.libsecret ]; })
(pkgs.writeShellScriptBin "rustup" (builtins.readFile ./nix/fake-rustup.sh))
@ -79,7 +78,7 @@
pname = package.name;
version = package.version;
pubspecLock = fromYAML "${src}/pubspec.lock";
pubspecLock = importYAML "${src}/pubspec.lock";
gitHashes = {
flutter_chat_ui = "sha256-4fuag7lRH5cMBFD3fUzj2K541JwXLoz8HF/4OMr3uhk=";
flutter_link_previewer = "sha256-4fuag7lRH5cMBFD3fUzj2K541JwXLoz8HF/4OMr3uhk=";