From a43abde2e55564958d565862294c1947c832460d Mon Sep 17 00:00:00 2001 From: guangtao Date: Tue, 30 Apr 2024 22:25:24 -0700 Subject: [PATCH] feat(pops.data): remove allData --- flake.lock | 16 ++++++++-------- src/pops/allData.nix | 26 -------------------------- src/pops/data.nix | 13 ++++++++++++- tests/data/expr.nix | 2 +- units/std/mkBlocks/data.nix | 2 +- 5 files changed, 22 insertions(+), 37 deletions(-) delete mode 100644 src/pops/allData.nix diff --git a/flake.lock b/flake.lock index 047de30..d2b4c56 100644 --- a/flake.lock +++ b/flake.lock @@ -29,11 +29,11 @@ }, "call-flake": { "locked": { - "lastModified": 1712452916, + "lastModified": 1713662534, "narHash": "sha256-B9uOqvhDhHnK+kwW/mfI/rAtlXuYlipdOss/L7gBOjs=", "owner": "divnix", "repo": "call-flake", - "rev": "9da1222f5227ff549642c159096c3dc9bbc73dcb", + "rev": "c7363f1696b45fcf678dd8bb40aa6b3acecef51d", "type": "github" }, "original": { @@ -81,11 +81,11 @@ "yants": "yants" }, "locked": { - "lastModified": 1713767657, - "narHash": "sha256-4+cA8CQOTVQJEw+26p69pITPvW6/oz+W2dAqG9N0fyk=", + "lastModified": 1714540585, + "narHash": "sha256-BnsoLEpQvki59F6H9oFFzvsgYAjtyFTm+vdCDmwo+Xk=", "owner": "gtrunsec", "repo": "flops", - "rev": "4067970d24c57c0d28971475f3620adab1a758c5", + "rev": "8eca30c3008a29c53b53776886a9eeaddf87b1a1", "type": "github" }, "original": { @@ -117,11 +117,11 @@ }, "nixlib": { "locked": { - "lastModified": 1712450863, - "narHash": "sha256-K6IkdtMtq9xktmYPj0uaYc8NsIqHuaAoRBaMgu9Fvrw=", + "lastModified": 1713660444, + "narHash": "sha256-2bVnrEGyWJhRNKspzfTJmVD/fsH9HQURD4cWpz79Ulw=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "3c62b6a12571c9a7f65ab037173ee153d539905f", + "rev": "6882347415e352cfc9c277cc01f73e0f5cb7b93c", "type": "github" }, "original": { diff --git a/src/pops/allData.nix b/src/pops/allData.nix deleted file mode 100644 index 7e0f3f6..0000000 --- a/src/pops/allData.nix +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The omnibus Authors -# SPDX-FileCopyrightText: 2024 The omnibus Authors -# -# SPDX-License-Identifier: MIT - -{ - super, - root, - haumea, -}: -(super.data.addLoadExtender { - load = { - loader = with haumea; [ - (matchers.regex "^(.+)\\.(yaml|yml)$" ( - _: inputs: path: - let - inherit - (root.errors.requiredInputs inputs.inputs "omnibus.pops.allData" [ "nixpkgs" ]) - nixpkgs - ; - in - root.ops.readYAML nixpkgs path - )) - ]; - }; -}) diff --git a/src/pops/data.nix b/src/pops/data.nix index b9c273c..4e660b3 100644 --- a/src/pops/data.nix +++ b/src/pops/data.nix @@ -3,12 +3,23 @@ # # SPDX-License-Identifier: MIT -{ haumea, flops }: +{ + haumea, + flops, + root, +}: flops.haumea.pops.default.setInit { loader = with haumea; [ matchers.json matchers.toml (matchers.nix loaders.scoped) (matchers.nix loaders.default) + (matchers.regex "^(.+)\\.(yaml|yml)$" ( + _: inputs: path: + if inputs ? inputs && inputs.inputs ? nixpkgs then + root.ops.readYAML inputs.inputs.nixpkgs path + else + path + )) ]; } diff --git a/tests/data/expr.nix b/tests/data/expr.nix index d653d2b..046e4dc 100644 --- a/tests/data/expr.nix +++ b/tests/data/expr.nix @@ -7,7 +7,7 @@ let inherit (omnibus.flake.inputs) nixpkgs; in -(omnibus.pops.allData.addLoadExtender { +(omnibus.pops.data.addLoadExtender { load = { src = ./__fixture; inputs = { diff --git a/units/std/mkBlocks/data.nix b/units/std/mkBlocks/data.nix index 2f11b14..19754cb 100644 --- a/units/std/mkBlocks/data.nix +++ b/units/std/mkBlocks/data.nix @@ -2,4 +2,4 @@ # # SPDX-License-Identifier: MIT -{ omnibus }: omnibus.pops.allData +{ omnibus }: omnibus.pops.data