blob: ed751566bd9c2af6327e6495403a647fe47efddc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
{ lib, depot, ... }:
{
mkFeaturePowerset = { crateName, features, override ? { } }:
let
powerset = xs:
let
addElement = set: element:
set ++ map (e: [ element ] ++ e) set;
in
lib.foldl' addElement [ [ ] ] xs;
in
lib.listToAttrs (map
(featuresPowerset: {
name = if featuresPowerset != [ ] then "with-features-${lib.concatStringsSep "-" featuresPowerset}" else "no-features";
value = depot.tvix.crates.workspaceMembers.${crateName}.build.override (old: {
runTests = true;
features = featuresPowerset;
} // (if lib.isFunction override then override old else override)
);
})
(powerset features));
}
|