Home

nur @main - refs - log -
-
https://git.jolheiser.com/nur.git
My NUR
tree log patch
Merge pull request #5 from nix-community/only-build-free Only build free packages
Signature
-----BEGIN PGP SIGNATURE----- wsBcBAABCAAQBQJclnp3CRBK7hj4Ov3rIwAAdHIIAA9aXAcDo3ERBmjBPjwUhZeT 20ALJhAicqattG7Yej5wTrZ9VZdZ6mLZMQOod4Xg9uPdhznN/dV3GMCGqcj9xvnE 22ZX+anV7x4tiEqQbl6qcjYA0eDIiuiulj/2rl0G+J/a5LPXUaxyWNPSxukLJfO0 ZcqhZWZRK83wA7paAuVguAWakk94zUTgfaC9euuoGBBVtbc94w1U5Cwc6gy7mcUh dBj/79HYM0dO3SE0mBSscdEuokJ25IHsYJbYTCq0lV6ponUCs3ZnnbXYFFpx2In7 tLcCTIhGW/QUTd+WRpdOdIVVGjGkdFuBFcbffn52EPtq0ycsCzheFoN+2rxNisw= =t+sD -----END PGP SIGNATURE-----
Francesco Gazzetta <fgaz@fgaz.me>
5 years ago
4 changed files, 41 additions(+), 38 deletions(-)
M .travis.yml -> .travis.yml
diff --git a/.travis.yml b/.travis.yml
index 66ece26cb778b3d8812bf2efa33fbc4c0c2171bb..e1d61177407fc115c950385483068fd97cb83c2a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -23,7 +23,7 @@  - travis_retry nix-channel --update
 
 script:
 
-language: nix
+  include:
  - nix eval -f default.nix 'lib'
  - nix eval -f default.nix 'modules'
  - nix eval -f default.nix 'overlays'
I buildable.nix
diff --git a/buildable.nix b/buildable.nix
new file mode 100644
index 0000000000000000000000000000000000000000..2b61b1f7627f912a2597c1369e0cd97f7c27eac4
--- /dev/null
+++ b/buildable.nix
@@ -0,0 +1,28 @@
+# This file filters out all the unbuildable packages from your package set.
+# It's what gets built by CI, so if you correctly mark broken/unfree packages
+# as such your CI will not try to build them and the buildable packages will
+# be added to the cache.
+{ pkgs ? import <nixpkgs> {} }:
+
+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: p.meta.broken or false;
+  isFree = p: p.meta.license.free or true;
+in filterSet
+     (n: !(isReserved n)) # filter out non-packages
+     (p: (builtins.isAttrs p)
+       && !(isBroken p)
+       && isFree p
+     )
+     (import ./default.nix { inherit pkgs; })
+
D non-broken.nix
diff --git a/non-broken.nix b/non-broken.nix
deleted file mode 100644
index b9a2cf9c6501ea634a8dd95428f855501b436b61..0000000000000000000000000000000000000000
--- a/non-broken.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-# This file filters out all the broken packages from your package set.
-# It's what gets built by CI, so if you correctly mark broken packages as
-# broken your CI will not try to build them and the non-broken packages will
-# be added to the cache.
-{ pkgs ? import <nixpkgs> {} }:
-
-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)
-          )
-        )
-      );
-in filterSet
-     (n: !(n=="lib"||n=="overlays"||n=="modules")) # filter out non-packages
-     (p: (builtins.isAttrs p)
-       && !(
-             (builtins.hasAttr "meta" p)
-             && (builtins.hasAttr "broken" p.meta)
-             && (p.meta.broken)
-           )
-     )
-     (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; })