Skip to content

Commit 5a8ccdb

Browse files
authored
Refactor overlay composition (#3323)
… so that it's easier to add and remove overlays by creating a list of overlays to compose. This should be a behavior-preserving change.
1 parent 9d70df0 commit 5a8ccdb

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

flake.nix

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -195,17 +195,23 @@
195195
hlsSources =
196196
builtins.mapAttrs (_: dir: gitignoreSource dir) sourceDirs;
197197

198-
extended = hpkgs:
199-
(hpkgs.override (old: {
200-
overrides = lib.composeExtensions (old.overrides or (_: _: { }))
201-
haskellOverrides;
202-
})).extend (hself: hsuper:
203-
# disable all checks for our packages
204-
builtins.mapAttrs (_: drv: haskell.lib.dontCheck drv)
205-
(lib.composeExtensions
206-
(haskell.lib.packageSourceOverrides hlsSources) tweaks hself
207-
hsuper));
208-
198+
# Disable tests, but only for the packages mentioned in this overlay
199+
#
200+
# We don't want to disable tests for *all* packages
201+
dontCheck = overlay: hself: hsuper:
202+
builtins.mapAttrs (_: haskell.lib.dontCheck)
203+
(overlay hself hsuper);
204+
205+
extended = hpkgs: hpkgs.override (old: {
206+
overrides =
207+
lib.fold
208+
lib.composeExtensions
209+
(old.overrides or (_: _: { }))
210+
[ haskellOverrides
211+
(dontCheck (haskell.lib.packageSourceOverrides hlsSources))
212+
tweaks
213+
];
214+
});
209215
in {
210216
inherit hlsSources;
211217

0 commit comments

Comments
 (0)