2019-03-23 19:13:30 +01:00
|
|
|
# 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
|
2018-07-16 14:14:10 +02:00
|
|
|
# be added to the cache.
|
2018-07-21 15:55:00 +02:00
|
|
|
{ pkgs ? import <nixpkgs> {} }:
|
2018-07-16 14:14:10 +02:00
|
|
|
|
2019-03-23 19:03:43 +01:00
|
|
|
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)
|
2018-07-16 14:14:10 +02:00
|
|
|
)
|
2019-03-23 19:03:43 +01:00
|
|
|
)
|
|
|
|
);
|
|
|
|
isReserved = n: builtins.elem n ["lib" "overlays" "modules"];
|
|
|
|
isBroken = p: ({ meta.broken = false; } // p).meta.broken;
|
2019-03-23 19:05:38 +01:00
|
|
|
isFree = p: ({ meta.license.free = true; } // p).meta.license.free;
|
2018-07-16 14:14:10 +02:00
|
|
|
in filterSet
|
2019-03-23 19:03:43 +01:00
|
|
|
(n: !(isReserved n)) # filter out non-packages
|
2018-07-16 14:14:10 +02:00
|
|
|
(p: (builtins.isAttrs p)
|
2019-03-23 19:03:43 +01:00
|
|
|
&& !(isBroken p)
|
2019-03-23 19:05:38 +01:00
|
|
|
&& isFree p
|
2018-07-16 14:14:10 +02:00
|
|
|
)
|
2018-07-21 15:55:00 +02:00
|
|
|
(import ./default.nix { inherit pkgs; })
|
2018-07-16 14:14:10 +02:00
|
|
|
|