@@ -28,7 +28,8 @@ with haskellLib;
29 in libComp (subComps z);
29 in libComp (subComps z);
31− getAllComponents = foldComponents subComponentTypes (c: acc: [c] ++ acc) [];
31+ getAllComponents = foldComponents subComponentTypes (c: acc:
32+ lib.optional c.buildable c ++ acc) [];
33 componentPrefix = {
34 componentPrefix = {
34 # Are all of these right?
35 # Are all of these right?
@@ -45,9 +46,12 @@ with haskellLib;
45 applyLibrary = cname: f { cname = config.package.identifier.name; ctype = "lib"; };
46 applyLibrary = cname: f { cname = config.package.identifier.name; ctype = "lib"; };
46 applySubComp = ctype: cname: f { inherit cname; ctype = componentPrefix.${ctype} or (throw "Missing component mapping for ${ctype}."); };
47 applySubComp = ctype: cname: f { inherit cname; ctype = componentPrefix.${ctype} or (throw "Missing component mapping for ${ctype}."); };
47 applyAllComp = f { cname = config.package.identifier.name; ctype = "all"; };
48 applyAllComp = f { cname = config.package.identifier.name; ctype = "all"; };
49+ buildableAttrs = lib.filterAttrs (n: comp: comp.buildable or true);
50+ libComp = if comps.library == null || !(comps.library.buildable or true)
48− libComp = if comps.library == null then {} else lib.mapAttrs applyLibrary (removeAttrs comps (subComponentTypes ++ [ "all" ]));
52+ else lib.mapAttrs applyLibrary (removeAttrs comps (subComponentTypes ++ [ "all" ]));
49 subComps = lib.mapAttrs
53 subComps = lib.mapAttrs
50− (ctype: lib.mapAttrs (applySubComp ctype))
54+ (ctype: attrs: lib.mapAttrs (applySubComp ctype) (buildableAttrs attrs))
51 (builtins.intersectAttrs (lib.genAttrs subComponentTypes (_: null)) comps);
55 (builtins.intersectAttrs (lib.genAttrs subComponentTypes (_: null)) comps);
52 allComp = { all = applyAllComp comps.all; };
56 allComp = { all = applyAllComp comps.all; };
53 in subComps // libComp // allComp;
57 in subComps // libComp // allComp;