2018-10-27 23:06:29 +00:00
|
|
|
{stdenv, lib}:
|
|
|
|
{
|
|
|
|
kernel = stdenv.hostPlatform.parsed.kernel.name;
|
|
|
|
abi = stdenv.hostPlatform.parsed.abi.name;
|
2018-11-22 11:40:03 +00:00
|
|
|
cpu = stdenv.hostPlatform.parsed.cpu.name;
|
2019-12-11 20:53:42 +00:00
|
|
|
updateFeatures = f: up: functions: lib.deepSeq f (lib.foldl' (features: fun: fun features) (lib.attrsets.recursiveUpdate f up) functions);
|
2018-10-27 23:06:29 +00:00
|
|
|
mapFeatures = features: map (fun: fun { features = features; });
|
2019-12-11 20:53:42 +00:00
|
|
|
mkFeatures = feat: lib.foldl (features: featureName:
|
2018-10-27 23:06:29 +00:00
|
|
|
if feat.${featureName} or false then
|
|
|
|
[ featureName ] ++ features
|
|
|
|
else
|
|
|
|
features
|
2019-12-11 20:53:42 +00:00
|
|
|
) [] (lib.attrNames feat);
|
2020-01-06 23:39:46 +00:00
|
|
|
include = includedFiles: src: builtins.filterSource (path: type:
|
2019-12-11 20:53:42 +00:00
|
|
|
lib.any (f:
|
2018-11-22 11:40:03 +00:00
|
|
|
let p = toString (src + ("/" + f));
|
|
|
|
in
|
2019-03-25 14:18:12 +00:00
|
|
|
p == path || (lib.strings.hasPrefix (p + "/") path)
|
2018-11-22 11:40:03 +00:00
|
|
|
) includedFiles
|
2018-10-27 23:06:29 +00:00
|
|
|
) src;
|
2020-01-06 23:39:46 +00:00
|
|
|
exclude = excludedFiles: src: builtins.filterSource (path: type:
|
2019-12-11 20:53:42 +00:00
|
|
|
lib.all (f:
|
2018-10-27 23:06:29 +00:00
|
|
|
!lib.strings.hasPrefix (toString (src + ("/" + f))) path
|
|
|
|
) excludedFiles
|
|
|
|
) src;
|
|
|
|
}
|