diff --git a/non-broken.nix b/non-broken.nix index b9a2cf9..35778c2 100644 --- a/non-broken.nix +++ b/non-broken.nix @@ -4,24 +4,23 @@ # be added to the cache. { pkgs ? import {} }: -let filterSet = - (f: g: s: builtins.listToAttrs - (map - (n: { name = n; value = builtins.getAttr n s; }) - (builtins.filter - (n: f n && g (builtins.getAttr n s)) - (builtins.attrNames s) - ) +let + filterSet = + (f: g: s: builtins.listToAttrs + (map + (n: { name = n; value = builtins.getAttr n s; }) + (builtins.filter + (n: f n && g (builtins.getAttr n s)) + (builtins.attrNames s) ) - ); + ) + ); + isReserved = n: builtins.elem n ["lib" "overlays" "modules"]; + isBroken = p: ({ meta.broken = false; } // p).meta.broken; in filterSet - (n: !(n=="lib"||n=="overlays"||n=="modules")) # filter out non-packages + (n: !(isReserved n)) # filter out non-packages (p: (builtins.isAttrs p) - && !( - (builtins.hasAttr "meta" p) - && (builtins.hasAttr "broken" p.meta) - && (p.meta.broken) - ) + && !(isBroken p) ) (import ./default.nix { inherit pkgs; }) diff --git a/overlay.nix b/overlay.nix index 082b038..bda4332 100644 --- a/overlay.nix +++ b/overlay.nix @@ -4,18 +4,20 @@ self: super: -let filterSet = - (f: g: s: builtins.listToAttrs - (map - (n: { name = n; value = builtins.getAttr n s; }) - (builtins.filter - (n: f n && g (builtins.getAttr n s)) - (builtins.attrNames s) - ) +let + filterSet = + (f: g: s: builtins.listToAttrs + (map + (n: { name = n; value = builtins.getAttr n s; }) + (builtins.filter + (n: f n && g (builtins.getAttr n s)) + (builtins.attrNames s) ) - ); + ) + ); + isReserved = n: builtins.elem n ["lib" "overlays" "modules"]; in filterSet - (n: !(n=="lib"||n=="overlays"||n=="modules")) # filter out non-packages + (n: !(isReserved n)) # filter out non-packages (p: true) # all packages are ok (import ./default.nix { pkgs = super; })