1{
2 pkgs ? import <nixpkgs> { },
3 feature,
4}:
5
6pkgs.runCommandNoCC "${feature}-present-structured"
7 {
8 __structuredAttrs = true;
9 requiredSystemFeatures = [ feature ];
10 }
11 ''
12 if [[ -e /${feature}-files ]]; then
13 touch $out
14 else
15 echo "The host declares ${feature} support, but doesn't expose /${feature}-files" >&2
16 echo "Do we fail to parse __structuredAttrs=true derivations?" >&2
17 fi
18 ''