forked from haskell-nix/hnix-store
-
Notifications
You must be signed in to change notification settings - Fork 0
/
matrix.nix
33 lines (31 loc) · 1.02 KB
/
matrix.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Matrix build for all packages and compilers
#
# Uses ./.github/workflows/ci.dhall as a single source of
# truth for a list of supported compilers
#
# The dhall expression needs to be frozen via dhall freeze
# which is done automatically when we update it via ./.github/workflows/ci.sh
# and dhallDirectoryToNix uses ci.dhall.frozen instead
{ pkgs ? import <nixpkgs> {}
}:
let
lib = pkgs.lib;
ciDhallNix = pkgs.dhallDirectoryToNix { src = ./.github/workflows; file = "ci.dhall.frozen"; };
ciCompilers = ciDhallNix.jobs.build.strategy.matrix.ghc;
# from e.g. 9.6.3 to ghc963
convertCompilers = cs:
map (x: "ghc${lib.strings.replaceStrings ["."] [""] x}") cs;
compilers =
lib.traceValFn (cs:
let
prettyCs = lib.concatMapStringsSep "\n" (c: "- ${c}") cs;
in
"building for compilers:\n${prettyCs}")
(convertCompilers ciCompilers);
in
pkgs.lib.recurseIntoAttrs
(pkgs.lib.genAttrs compilers (compiler:
pkgs.lib.recurseIntoAttrs
(import ./. { inherit pkgs compiler; })
)
)