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