-
Notifications
You must be signed in to change notification settings - Fork 1
/
non-broken.nix
41 lines (40 loc) · 1.04 KB
/
non-broken.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# 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.
{ ... } @ args:
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)
)
&& !(
(builtins.hasAttr "disabled" p)
&& (p.disabled)
)
&& !(
(builtins.hasAttr "meta" p)
&& (builtins.hasAttr "available" p.meta)
&& (!p.meta.available)
)
)
(import ./. args)