2
0
Fork 0
genodepkgs/ports/default.nix

25 lines
577 B
Nix

{ nixpkgs, ... } @ args:
let
tool = import ./../tool { inherit nixpkgs; };
importPort = path:
let f = (import path);
in f (builtins.intersectAttrs (builtins.functionArgs f) (tool // args));
hasSuffixNix = tool.hasSuffix ".nix";
in
builtins.listToAttrs (
builtins.filter
(x: x != null)
(map
(fn:
if fn != "default.nix" then
{ name = tool.replaceInString ".nix" "" fn;
value = importPort (../ports + "/${fn}");
}
else null
)
(builtins.attrNames (builtins.readDir ../ports))
)
)