on iko/ghcjs-patch-master help sign in
Use config to set componentType defaults.
17ead94Will Fancher
modules/package.nix+15−11
@@ -97,11 +97,11 @@ in {
97 };
97 };
98
98
99 components = let
99 components = let
100− componentType = defaults: submodule {
100+ componentType = submodule {
101 options = {
101 options = {
102 depends = mkOption {
102 depends = mkOption {
103 type = listOfFilteringNulls unspecified;
103 type = listOfFilteringNulls unspecified;
104− default = defaults.depends or [];
104+ default = [];
105 };
105 };
106 libs = mkOption {
106 libs = mkOption {
107 type = listOfFilteringNulls (nullOr package);
107 type = listOfFilteringNulls (nullOr package);
@@ -137,11 +137,11 @@ in {
137 };
137 };
138 doExactConfig = mkOption {
138 doExactConfig = mkOption {
139 type = bool;
139 type = bool;
140− default = false;
140+ default = config.doExactConfig;
141 };
141 };
142 doCheck = mkOption {
142 doCheck = mkOption {
143 type = bool;
143 type = bool;
144− default = defaults.doCheck or false;
144+ default = config.doCheck;
145 };
145 };
146 doCrossCheck = mkOption {
146 doCrossCheck = mkOption {
147 type = bool;
147 type = bool;
@@ -151,30 +151,30 @@ in {
151 };
151 };
152 in {
152 in {
153 library = mkOption {
153 library = mkOption {
154− type = componentType {};
154+ type = componentType;
155 };
155 };
156 sublibs = mkOption {
156 sublibs = mkOption {
157− type = attrsOf (componentType {});
157+ type = attrsOf componentType;
158 default = {};
158 default = {};
159 };
159 };
160 foreignlibs = mkOption {
160 foreignlibs = mkOption {
161− type = attrsOf (componentType {});
161+ type = attrsOf componentType;
162 default = {};
162 default = {};
163 };
163 };
164 exes = mkOption {
164 exes = mkOption {
165− type = attrsOf (componentType {});
165+ type = attrsOf componentType;
166 default = {};
166 default = {};
167 };
167 };
168 tests = mkOption {
168 tests = mkOption {
169− type = attrsOf (componentType { inherit (config) doCheck; });
169+ type = attrsOf componentType;
170 default = {};
170 default = {};
171 };
171 };
172 benchmarks = mkOption {
172 benchmarks = mkOption {
173− type = attrsOf (componentType {});
173+ type = attrsOf componentType;
174 default = {};
174 default = {};
175 };
175 };
176 all = mkOption {
176 all = mkOption {
177− type = componentType {};
177+ type = componentType;
178 description = "The merged dependencies of all other components";
178 description = "The merged dependencies of all other components";
179 };
179 };
180 };
180 };
@@ -269,6 +269,10 @@ in {
269 type = nullOr string;
269 type = nullOr string;
270 default = null;
270 default = null;
271 };
271 };
272+ doExactConfig = mkOption {
273+ type = bool;
274+ default = false;
275+ };
272 doCheck = mkOption {
276 doCheck = mkOption {
273 type = bool;
277 type = bool;
274 default = false;
278 default = false;