cluster/lib.nix
2021-01-11 18:35:35 +01:00

23 lines
608 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; } // inputs)
);
pkgsWithFlakes = flakes: import nixpkgs
{
inherit system;
overlays = builtins.concatLists (forEach flakes (flake:
if builtins.hasAttr "overlay" flake then
[ flake.overlay ]
else
[]
));
};
}