diff --git a/.travis.yml b/.travis.yml index e1d61177407fc115c950385483068fd97cb83c2a..66ece26cb778b3d8812bf2efa33fbc4c0c2171bb 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' diff --git a/buildable.nix b/buildable.nix deleted file mode 100644 index 2b61b1f7627f912a2597c1369e0cd97f7c27eac4..0000000000000000000000000000000000000000 --- a/buildable.nix +++ /dev/null @@ -1,28 +0,0 @@ -# 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 {} }: - -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; }) - diff --git a/non-broken.nix b/non-broken.nix new file mode 100644 index 0000000000000000000000000000000000000000..b9a2cf9c6501ea634a8dd95428f855501b436b61 --- /dev/null +++ b/non-broken.nix @@ -0,0 +1,27 @@ +# 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 {} }: + +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; }) + diff --git a/overlay.nix b/overlay.nix index bda4332a081fcd8c713733a27a02f0dc312cd32c..082b03836fd169bc00f6093001bf9c51459c999c 100644 --- a/overlay.nix +++ b/overlay.nix @@ -4,22 +4,20 @@ # to your configuration. self: super: -let +let filterSet = - filterSet = + (f: g: s: builtins.listToAttrs - (f: g: s: builtins.listToAttrs + (map - (map + (n: { name = n; value = builtins.getAttr n s; }) - (n: { name = n; value = builtins.getAttr n s; }) + (builtins.filter - (builtins.filter + (n: f n && g (builtins.getAttr n s)) -# 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 + (f: g: s: builtins.listToAttrs - (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. - (map (p: true) # all packages are ok (import ./default.nix { pkgs = super; })