From 7b4440ef01e1ab0f5276f9f182eaf22f58472b19 Mon Sep 17 00:00:00 2001 From: Gabriella Gonzalez Date: Mon, 7 Nov 2022 12:27:06 -0800 Subject: [PATCH] Refactor overlay composition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … 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. --- flake.nix | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/flake.nix b/flake.nix index 1e4a30ab26..94941a4321 100644 --- a/flake.nix +++ b/flake.nix @@ -195,17 +195,23 @@ hlsSources = builtins.mapAttrs (_: dir: gitignoreSource dir) sourceDirs; - extended = hpkgs: - (hpkgs.override (old: { - overrides = lib.composeExtensions (old.overrides or (_: _: { })) - haskellOverrides; - })).extend (hself: hsuper: - # disable all checks for our packages - builtins.mapAttrs (_: drv: haskell.lib.dontCheck drv) - (lib.composeExtensions - (haskell.lib.packageSourceOverrides hlsSources) tweaks hself - hsuper)); - + # Disable tests, but only for the packages mentioned in this overlay + # + # We don't want to disable tests for *all* packages + dontCheck = overlay: hself: hsuper: + builtins.mapAttrs (_: haskell.lib.dontCheck) + (overlay hself hsuper); + + extended = hpkgs: hpkgs.override (old: { + overrides = + lib.fold + lib.composeExtensions + (old.overrides or (_: _: { })) + [ haskellOverrides + (dontCheck (haskell.lib.packageSourceOverrides hlsSources)) + tweaks + ]; + }); in { inherit hlsSources;