git.iko.soy/nixpkgs-stackage
on master help sign in
Add release derivation
commitd7d216d9f2b45990d590f575eb76da5b53876993 authorDmitry Bushev <bushevdv@gmail.com> dateWed 27 Dec 2017, 13:01 (9 years ago) parent62b3111
2 files changed+27−1
haskell-overlay.nix+1−1 release.nix+26
haskell-overlay.nix+1−1
@@ -7,5 +7,5 @@ self: super:
77 };
88 };
99
10− stackage2nix = import ./stackage2nix { nixpkgs = self; };
10+ stackage2nix = import ./stackage2nix { nixpkgs = super; };
1111}
release.nixnew file+26
@@ -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+ ))