forked from reflex-frp/reflex-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
skeleton-test.nix
37 lines (34 loc) · 1.03 KB
/
skeleton-test.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
34
35
36
37
{ reflex-platform }:
let
skeletonSrc = reflex-platform.nixpkgs.fetchFromGitHub {
owner = "ElvishJerricco";
repo = "reflex-project-skeleton";
rev = "d1cf6b26a9aa08b192e3e81ae07a4ba00064d6d2";
sha256 = "05a3rq4ar77fpwl05z7niz025lp5wrwxzzz804jvwkamvyjxsyf2";
fetchSubmodules = false; # Not interested in its reflex-platform checkout
};
skeleton = import skeletonSrc { inherit reflex-platform; };
mkCabalProject = { shellDrv, projectFile }: shellDrv.overrideAttrs (old: {
name = "reflex-project-skeleton-${projectFile}";
src = skeletonSrc;
CABAL_CONFIG = builtins.toFile "cabal.config" ''
'';
buildPhase = ''
HOME=$NIX_BUILD_TOP
cabal new-build all --project-file=${projectFile}
'';
installPhase = ''
mv ./dist-newstyle $out
'';
});
in {
project = skeleton.all;
ghc = mkCabalProject {
shellDrv = skeleton.shells.ghc;
projectFile = "cabal.project";
};
ghcjs = mkCabalProject {
shellDrv = skeleton.shells.ghcjs;
projectFile = "cabal-ghcjs.project";
};
}