@@ -0,0 +1,26 @@
1+{ supportedSystems ? [ "x86_64-linux" "i686-linux" ]
2+, supportedStackageReleases ? [ "lts-100" ] }:
3+
4+let
5+ lib = (import <nixpkgs> {}).lib;
6+ release = import <nixpkgs/pkgs/top-level/release-lib.nix> {
7+ inherit supportedSystems;
8+ nixpkgsArgs = { overlays = [ (import ./haskell-overlay.nix) ]; };
9+ };
10+
11+ # hasSupportedSystem :: System -> Derivation -> Bool
12+ hasSupportedSystem = system: pkg:
13+ # Test `isAttrs pkg` to ensure that pkg is a derivation
14+ lib.isAttrs pkg && lib.elem system pkg.meta.platforms;
15+
16+ # genJobSet :: StackageRelease -> System -> AttrSet
17+ genJobSet = lts: system:
18+ lib.filterAttrs
19+ (_: pkg: hasSupportedSystem system pkg)
20+ (release.pkgsFor system).haskell.packages.stackage."${lts}";
21+
22+in
23+ lib.genAttrs supportedStackageReleases (stackage:
24+ lib.genAttrs supportedSystems (system:
25+ genJobSet stackage system
26+ ))