default out: filter unknown dirs
This commit is contained in:
parent
3bb7ba2af9
commit
0a479349f9
21
default.nix
21
default.nix
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user