zaphyra's git: haumea

fork of https://github.com/nix-community/haumea

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
{ haumea, lib }:

let
  inherit (builtins)
    elemAt
    ;

  inherit (lib)
    importJSON
    ;

  inherit (haumea) matchers;

  # just loads json, after all
  fakeLoadYaml = matches: _: path:
    let
      basename = elemAt matches 0;
      ext = elemAt matches 1;
    in
    {
      "${basename}.${ext}" = importJSON path;
    };
in

haumea.load {
  src = ./__fixture;
  loader = [
    (matchers.regex ''^(.+)\.(yaml|yml)$'' fakeLoadYaml)
    (matchers.nix haumea.loaders.default)
    matchers.json
    matchers.toml
    (matchers.always haumea.loaders.path)
  ];
}