default out: filter unknown dirs
This commit is contained in:
parent
3bb7ba2af9
commit
0a479349f9
15
default.nix
15
default.nix
@ -12,13 +12,18 @@ let
|
||||
user-pkgs-path = ./. + "/${current-user-name}/5pkgs";
|
||||
|
||||
out =
|
||||
lib.mapAttrs (_: builtins.getAttr "main")
|
||||
(lib.filterAttrs (_: builtins.hasAttr "main")
|
||||
(lib.mapAttrs
|
||||
(k: v:
|
||||
if builtins.pathExists (./. + "/${k}/1systems")
|
||||
then mk-namespace (./. + "/${k}")
|
||||
else import (./. + "/${k}"))
|
||||
(lib.filterAttrs
|
||||
(k: v: !lib.hasPrefix "." k && v == "directory")
|
||||
if lib.hasPrefix "." k || v != "directory" then
|
||||
{}
|
||||
else if builtins.pathExists (./. + "/${k}/default.nix") then
|
||||
{ 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> {
|
||||
|
Loading…
Reference in New Issue
Block a user