forked from typeable/schematic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.nix
32 lines (26 loc) · 898 Bytes
/
release.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
{ schematicSrc ? { outPath = ./.; revCount = 0; gitTag = "dirty"; }
, supportedSystems ? [ "x86_64-linux" ]
}:
let
_nixpkgs = import <nixpkgs> {};
inherit (_nixpkgs) pkgs lib;
stackageOverlayPath = pkgs.fetchFromGitHub {
owner = "typeable";
repo = "nixpkgs-stackage";
rev = "abe0a03ba2bde609b0707ce45301ec836cb3ed29";
sha256 = "0ksdk83zbsgvs30izwsfyjh4xxwz8dsn9a5igrs3pjap4whpzqfv";
};
nixpkgsArgs = {
overlays = [ (import stackageOverlayPath) ];
};
release = import <nixpkgs/pkgs/top-level/release-lib.nix> { inherit nixpkgsArgs supportedSystems; };
mkStackage = system:
let
nixpkgs = release.pkgsFor system;
stackage = nixpkgs.haskell.packages.stackage.lib.callStackage2nix "schematic" schematicSrc { inherit nixpkgs; };
in
stackage;
in
lib.genAttrs supportedSystems (system: {
inherit (mkStackage system) schematic;
})