From bf51372de49e17dff763fde2d241e9b2b93e0891 Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Tue, 3 Dec 2019 17:05:56 +1300 Subject: [PATCH] Inline collectChecks --- default.nix | 8 ++------ nix/util.nix | 5 +++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/default.nix b/default.nix index 1ad741313d8..444ba2a732f 100644 --- a/default.nix +++ b/default.nix @@ -24,11 +24,6 @@ let inherit pkgs src jmPkgs; }; - collectChecks = packageSel: haskellPackages: - (pkgs.lib.mapAttrs (_: package: package.checks // { recurseForDerivations = true; }) - (pkgs.lib.filterAttrs (name: package: (package.isHaskell or false) && packageSel package) haskellPackages)) - // { recurseForDerivations = true; }; - self = { inherit pkgs iohkLib src haskellPackages; inherit jormungandr jormungandr-cli; @@ -41,7 +36,8 @@ let haskellBuildUtils = iohkLib.haskellBuildUtils.package; }; - tests = collectChecks isCardanoWallet haskellPackages; + tests = pkgs.recurseIntoAttrs (pkgs.lib.mapAttrs (_: package: package.checks) + (pkgs.lib.filterAttrs (_: package: isCardanoWallet package) haskellPackages)); benchmarks = collectComponents "benchmarks" isCardanoWallet haskellPackages; dockerImage = pkgs.callPackage ./nix/docker.nix { diff --git a/nix/util.nix b/nix/util.nix index e9a0621ec0a..1f2cfa96b83 100644 --- a/nix/util.nix +++ b/nix/util.nix @@ -4,8 +4,9 @@ with pkgs.lib; { isCardanoWallet = package: - (hasPrefix "cardano-wallet" package.identifier.name) || - (elem package.identifier.name [ "text-class" "bech32" ]); + (package.isHaskell or false) && + ((hasPrefix "cardano-wallet" package.identifier.name) || + (elem package.identifier.name [ "text-class" "bech32" ])); inherit (pkgs.haskell-nix.haskellLib) collectComponents; }