Skip to content

Commit

Permalink
feat: add a convenience block target load finder
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Aug 12, 2023
1 parent ad86414 commit 8de984b
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@
src,
}:
# modules/profiles are always functions
{config, options, ...}: let
cr = cell._cr ++ [ baseNameOf src ];
file = "${inputs.self.outPath}#${lib.concatStringsSep "/" cr}";
{
config,
options,
...
}: let
cr = cell._cr ++ [baseNameOf src];
file = "${inputs.self.outPath}#${lib.concatStringsSep "/" cr}";
in
lib.setDefaultModuleLocation file (haumea.lib.load {
inherit src;
Expand All @@ -50,10 +54,24 @@
];
inputs = {inherit inputs cell config options;};
});

findLoad = {
inputs,
cell,
block,
}:
with builtins;
mapAttrs
(n: _:
load {
inherit inputs cell;
src = block + /${n};
})
(lib.filterAttrs (_: v: v == "directory") (readDir block));
in
haumea.lib
// {
inherit load;
inherit load findLoad;
inherit (hive) blockTypes collect;
inherit (inputs.paisano) grow growOn pick harvest winnow;
};
Expand Down

0 comments on commit 8de984b

Please sign in to comment.