Skip to content

Commit

Permalink
feat: add loadData
Browse files Browse the repository at this point in the history
  • Loading branch information
GTrunSec committed Sep 21, 2023
1 parent c749af7 commit 060c869
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
15 changes: 1 addition & 14 deletions examples/nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,9 @@ let
exporter = lib.mapAttrs (_: v: v.exports) (
lib.removeAttrs super.pops [ "inputs" ]
);

data =
(POS.loadData.addLoadExtender {
loader =
with haumea;
[
# without the nixpkgs requirement, only the nixpkgs.lib
(matchers.regex "^(.+)\\.(yaml|yml)$" (
_: _: path:
super.pops.inputs.outputs.std.lib.ops.readYAML path
))
];
}).outputsForTarget.default;
in
{
inherit data;
data = exporter.data.default;

nixosSuites = lib.flatten [
exporter.selfNixOSProfiles.default.bootstrap
Expand Down
8 changes: 8 additions & 0 deletions examples/nixos/pops/data.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(POS.loadData.addLoadExtender {
loader = with haumea; [
(matchers.regex "^(.+)\\.(yaml|yml)$" (
_: _: path:
super.inputs.outputs.std.lib.ops.readYAML path
))
];
})
1 change: 1 addition & 0 deletions examples/nixos/pops/selfNixOSProfiles.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
inputs = {
POS = {
nixosProfiles = super.nixosProfiles.outputsForTarget.nixosProfiles;
data = super.data.outputsForTarget.default;
};
};
}).addExporters
Expand Down

0 comments on commit 060c869

Please sign in to comment.