forked from Henry-Hiles/nexus
rename fromYAML -> importYAML
this is more consistent with existing nixpkgs.lib functions
This commit is contained in:
parent
32393f12c0
commit
f72c59f79d
1 changed files with 5 additions and 7 deletions
12
flake.nix
12
flake.nix
|
|
@ -33,15 +33,13 @@
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
|
||||||
# from https://discourse.nixos.org/t/is-there-a-way-to-read-a-yaml-file-and-get-back-a-set/18385/5
|
# 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:
|
file:
|
||||||
builtins.fromJSON (
|
lib.importJSON (
|
||||||
builtins.readFile (
|
pkgs.runCommand "converted-yaml.json" { } ''${pkgs.yj}/bin/yj < "${file}" > "$out"''
|
||||||
pkgs.runCommand "converted-yaml.json" { } ''${pkgs.yj}/bin/yj < "${file}" > "$out"''
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
package = fromYAML "${src}/pubspec.yaml";
|
package = importYAML "${src}/pubspec.yaml";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
_module.args.pkgs = import nixpkgs {
|
_module.args.pkgs = import nixpkgs {
|
||||||
|
|
@ -79,7 +77,7 @@
|
||||||
pname = package.name;
|
pname = package.name;
|
||||||
version = package.version;
|
version = package.version;
|
||||||
|
|
||||||
pubspecLock = fromYAML "${src}/pubspec.lock";
|
pubspecLock = importYAML "${src}/pubspec.lock";
|
||||||
gitHashes = {
|
gitHashes = {
|
||||||
flutter_chat_ui = "sha256-4fuag7lRH5cMBFD3fUzj2K541JwXLoz8HF/4OMr3uhk=";
|
flutter_chat_ui = "sha256-4fuag7lRH5cMBFD3fUzj2K541JwXLoz8HF/4OMr3uhk=";
|
||||||
flutter_link_previewer = "sha256-4fuag7lRH5cMBFD3fUzj2K541JwXLoz8HF/4OMr3uhk=";
|
flutter_link_previewer = "sha256-4fuag7lRH5cMBFD3fUzj2K541JwXLoz8HF/4OMr3uhk=";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue