From f72c59f79d21531aab6366ebe5727071f7fe8cb6 Mon Sep 17 00:00:00 2001 From: Elec3137 Date: Sun, 1 Feb 2026 14:13:29 -0800 Subject: [PATCH] rename fromYAML -> importYAML this is more consistent with existing nixpkgs.lib functions --- flake.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index a167232..5c2c10a 100644 --- a/flake.nix +++ b/flake.nix @@ -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 { @@ -79,7 +77,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=";