From a11f1f4e2f080404d4c24847f41cbb2c1562a188 Mon Sep 17 00:00:00 2001 From: Astro Date: Fri, 12 Mar 2021 01:56:27 +0100 Subject: [PATCH] flake.nix: add hydraJobs against all ghc versions --- flake.nix | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index fbf567e..64dded4 100644 --- a/flake.nix +++ b/flake.nix @@ -5,7 +5,7 @@ let systems = [ "x86_64-linux" "i686-linux" "aarch64-linux" ]; forSystems = nixpkgs.lib.genAttrs systems; - in { + in rec { packages = forSystems (system: { yammat = nixpkgs.legacyPackages.${system}.haskellPackages.callPackage ./pkg.nix {}; }); @@ -14,6 +14,26 @@ self.packages.${system}.yammat ); + checks = packages; + + hydraJobs = forSystems (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + ghcVersions = + builtins.filter (p: + builtins.match "ghc.+" p != null + ) (builtins.attrNames pkgs.haskell.packages); + in + builtins.foldl' (checks: ghcVersion: + let + haskellPackages = pkgs.haskell.packages.${ghcVersion}; + in + checks // { + "yammat-${ghcVersion}" = haskellPackages.callPackage ./pkg.nix {}; + } + ) {} ghcVersions + ); + devShell = forSystems (system: import ./shell.nix { nixpkgs = nixpkgs.legacyPackages.${system};