2023-10-19 09:42:26 +01:00
|
|
|
{
|
2024-06-20 22:33:51 +01:00
|
|
|
pkgs ? import <nixpkgs> { },
|
|
|
|
feature,
|
|
|
|
}:
|
2023-10-19 09:42:26 +01:00
|
|
|
|
2024-06-20 22:33:51 +01:00
|
|
|
pkgs.runCommandNoCC "${feature}-present-structured"
|
|
|
|
{
|
|
|
|
__structuredAttrs = true;
|
|
|
|
requiredSystemFeatures = [ feature ];
|
|
|
|
}
|
|
|
|
''
|
|
|
|
if [[ -e /${feature}-files ]]; then
|
|
|
|
touch $out
|
|
|
|
else
|
|
|
|
echo "The host declares ${feature} support, but doesn't expose /${feature}-files" >&2
|
|
|
|
echo "Do we fail to parse __structuredAttrs=true derivations?" >&2
|
|
|
|
fi
|
|
|
|
''
|