cluster/lib.nix
2021-01-11 21:30:37 +01:00

23 lines
615 B
Nix

{ nixpkgs, pkgs, system, inputs }:
with pkgs.lib; {
flakes = path: modules: genAttrs modules (module:
let
self = (import (path + "/${module}/flake.nix")).outputs (inputs // { inherit self; });
in
self
);
dockerImages = path: modules: genAttrs modules (module:
import (path + "/${module}") ({ inherit pkgs system; } // inputs)
);
pkgsWithFlakes = flakes: import nixpkgs
{
inherit system;
overlays = builtins.concatLists (forEach flakes (flake:
if builtins.hasAttr "overlay" flake then
[ flake.overlay ]
else
[]
));
};
}