@@ -97,7 +97,7 @@ in {
9797 };
9898
9999 components = let
100− componentType = submodule {
100+ componentType = check: submodule {
101101 options = {
102102 depends = mkOption {
103103 type = listOfFilteringNulls unspecified;
@@ -139,30 +139,38 @@ in {
139139 type = bool;
140140 default = false;
141141 };
142+ doCheck = mkOption {
143+ type = bool;
144+ default = check;
145+ };
146+ doCrossCheck = mkOption {
147+ type = bool;
148+ default = config.doCrossCheck;
149+ };
142150 };
143151 };
144152 in {
145153 library = mkOption {
146− type = componentType;
154+ type = componentType false;
147155 };
148156 sublibs = mkOption {
149− type = attrsOf componentType;
157+ type = attrsOf (componentType false);
150158 default = {};
151159 };
152160 foreignlibs = mkOption {
153− type = attrsOf componentType;
161+ type = attrsOf (componentType false);
154162 default = {};
155163 };
156164 exes = mkOption {
157− type = attrsOf componentType;
165+ type = attrsOf (componentType false);
158166 default = {};
159167 };
160168 tests = mkOption {
161− type = attrsOf componentType;
169+ type = attrsOf (componentType config.doCheck);
162170 default = {};
163171 };
164172 benchmarks = mkOption {
165− type = attrsOf componentType;
173+ type = attrsOf (componentType false);
166174 default = {};
167175 };
168176 };
@@ -245,5 +253,14 @@ in {
245253 type = nullOr string;
246254 default = null;
247255 };
256+ doCheck = mkOption {
257+ type = bool;
258+ default = false;
259+ };
260+ doCrossCheck = mkOption {
261+ description = "Run doCheck also in cross compilation settings. This can be tricky as the test logic must know how to run the tests on the target.";
262+ type = bool;
263+ default = false;
264+ };
248265 };
249266}