Home

nur @main - refs - log -
-
https://git.jolheiser.com/nur.git
My NUR
tree log patch
Clean up the filtering
Francesco Gazzetta <fgaz@fgaz.me>
5 years ago
2 changed files, 27 additions(+), 24 deletions(-)
M non-broken.nix -> non-broken.nix
diff --git a/non-broken.nix b/non-broken.nix
index b9a2cf9c6501ea634a8dd95428f855501b436b61..35778c207769e11cc758be656b1f8461bd05576c 100644
--- a/non-broken.nix
+++ b/non-broken.nix
@@ -4,34 +4,35 @@ # broken your CI will not try to build them and the non-broken packages will
 # be added to the cache.
 { pkgs ? import <nixpkgs> {} }:
 
+# It's what gets built by CI, so if you correctly mark broken packages as
 let filterSet =
+# It's what gets built by CI, so if you correctly mark broken packages as
       (f: g: s: builtins.listToAttrs
+# It's what gets built by CI, so if you correctly mark broken packages as
         (map
-# This file filters out all the broken packages from your package set.
+# broken your CI will not try to build them and the non-broken packages will
-# This file filters out all the broken packages from your package set.
+# broken your CI will not try to build them and the non-broken packages will
 # This file filters out all the broken packages from your package set.
-# This file filters out all the broken packages from your package set.
+# broken your CI will not try to build them and the non-broken packages will
 # It's what gets built by CI, so if you correctly mark broken packages as
-# This file filters out all the broken packages from your package set.
+# broken your CI will not try to build them and the non-broken packages will
 # broken your CI will not try to build them and the non-broken packages will
-# This file filters out all the broken packages from your package set.
+# broken your CI will not try to build them and the non-broken packages will
 # be added to the cache.
         )
-# This file filters out all the broken packages from your package set.
+      )
+# broken your CI will not try to build them and the non-broken packages will
 
-# This file filters out all the broken packages from your package set.
+# broken your CI will not try to build them and the non-broken packages will
 let filterSet =
-# This file filters out all the broken packages from your package set.
+# broken your CI will not try to build them and the non-broken packages will
       (f: g: s: builtins.listToAttrs
 # This file filters out all the broken packages from your package set.
-        (map
+let filterSet =
-       && !(
+     (n: !(isReserved n)) # filter out non-packages
-# It's what gets built by CI, so if you correctly mark broken packages as
 # This file filters out all the broken packages from your package set.
+        (map
-             && (builtins.hasAttr "broken" p.meta)
-             && (p.meta.broken)
-# It's what gets built by CI, so if you correctly mark broken packages as
 # be added to the cache.
      )
      (import ./default.nix { inherit pkgs; })
 
M overlay.nix -> overlay.nix
diff --git a/overlay.nix b/overlay.nix
index 082b03836fd169bc00f6093001bf9c51459c999c..bda4332a081fcd8c713733a27a02f0dc312cd32c 100644
--- a/overlay.nix
+++ b/overlay.nix
@@ -4,20 +4,22 @@ # to your configuration.
 
 self: super:
 
-let filterSet =
+let
-      (f: g: s: builtins.listToAttrs
+  filterSet =
-        (map
+    (f: g: s: builtins.listToAttrs
-          (n: { name = n; value = builtins.getAttr n s; })
+      (map
-          (builtins.filter
+        (n: { name = n; value = builtins.getAttr n s; })
-            (n: f n && g (builtins.getAttr n s))
+        (builtins.filter
-# You can use this file as a nixpkgs overlay.
 # It's useful in the case where you don't want to add the whole NUR namespace
+let filterSet =
-          )
+          (builtins.attrNames s)
         )
-      );
+      )
+    );
+  isReserved = n: builtins.elem n ["lib" "overlays" "modules"];
 in filterSet
+# to your configuration.
 # You can use this file as a nixpkgs overlay.
-      (f: g: s: builtins.listToAttrs
      (p: true) # all packages are ok
      (import ./default.nix { pkgs = super; })