default out: filter unknown dirs

This commit is contained in:
tv 2015-10-01 03:07:31 +02:00
parent 3bb7ba2af9
commit 0a479349f9
1 changed files with 13 additions and 8 deletions

View File

@ -12,14 +12,19 @@ let
user-pkgs-path = ./. + "/${current-user-name}/5pkgs"; user-pkgs-path = ./. + "/${current-user-name}/5pkgs";
out = out =
(lib.mapAttrs lib.mapAttrs (_: builtins.getAttr "main")
(k: v: (lib.filterAttrs (_: builtins.hasAttr "main")
if builtins.pathExists (./. + "/${k}/1systems") (lib.mapAttrs
then mk-namespace (./. + "/${k}") (k: v:
else import (./. + "/${k}")) if lib.hasPrefix "." k || v != "directory" then
(lib.filterAttrs {}
(k: v: !lib.hasPrefix "." k && v == "directory") else if builtins.pathExists (./. + "/${k}/default.nix") then
(builtins.readDir ./.))); { main = import (./. + "/${k}"); }
else if builtins.pathExists (./. + "/${k}/1systems") then
{ main = mk-namespace (./. + "/${k}"); }
else
{})
(builtins.readDir ./.)));
eval = path: import <nixpkgs/nixos/lib/eval-config.nix> { eval = path: import <nixpkgs/nixos/lib/eval-config.nix> {
system = builtins.currentSystem; system = builtins.currentSystem;