on iko/ghcjs-patch-master help sign in
Use config to set componentType defaults.
commit17ead947b06fece0734a7ae12359045353119d37 authorWill Fancher <elvishjerricco@gmail.com> dateSat 2 Feb 2019, 00:00 (8 years ago) parenta7568a0
1 file changed+15−11
modules/package.nix+15−11
modules/package.nix+15−11
@@ -97,11 +97,11 @@ in {
9797 };
9898
9999 components = let
100− componentType = defaults: submodule {
100+ componentType = submodule {
101101 options = {
102102 depends = mkOption {
103103 type = listOfFilteringNulls unspecified;
104− default = defaults.depends or [];
104+ default = [];
105105 };
106106 libs = mkOption {
107107 type = listOfFilteringNulls (nullOr package);
@@ -137,11 +137,11 @@ in {
137137 };
138138 doExactConfig = mkOption {
139139 type = bool;
140− default = false;
140+ default = config.doExactConfig;
141141 };
142142 doCheck = mkOption {
143143 type = bool;
144− default = defaults.doCheck or false;
144+ default = config.doCheck;
145145 };
146146 doCrossCheck = mkOption {
147147 type = bool;
@@ -151,30 +151,30 @@ in {
151151 };
152152 in {
153153 library = mkOption {
154− type = componentType {};
154+ type = componentType;
155155 };
156156 sublibs = mkOption {
157− type = attrsOf (componentType {});
157+ type = attrsOf componentType;
158158 default = {};
159159 };
160160 foreignlibs = mkOption {
161− type = attrsOf (componentType {});
161+ type = attrsOf componentType;
162162 default = {};
163163 };
164164 exes = mkOption {
165− type = attrsOf (componentType {});
165+ type = attrsOf componentType;
166166 default = {};
167167 };
168168 tests = mkOption {
169− type = attrsOf (componentType { inherit (config) doCheck; });
169+ type = attrsOf componentType;
170170 default = {};
171171 };
172172 benchmarks = mkOption {
173− type = attrsOf (componentType {});
173+ type = attrsOf componentType;
174174 default = {};
175175 };
176176 all = mkOption {
177− type = componentType {};
177+ type = componentType;
178178 description = "The merged dependencies of all other components";
179179 };
180180 };
@@ -269,6 +269,10 @@ in {
269269 type = nullOr string;
270270 default = null;
271271 };
272+ doExactConfig = mkOption {
273+ type = bool;
274+ default = false;
275+ };
272276 doCheck = mkOption {
273277 type = bool;
274278 default = false;