forked from reflex-frp/reflex-gadt-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.nix
30 lines (29 loc) · 1.26 KB
/
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
let systems = [ "x86_64-linux" "x86_64-darwin" ];
lib = (import ./example/.obelisk/impl {}).nixpkgs.lib;
in lib.genAttrs systems (system: let
ob = import ./example/.obelisk/impl { inherit system; };
pkgs = ob.reflex-platform.nixpkgs;
ghc = ob.reflex-platform.ghc.override {
overrides = self: super: {
aeson-qq = self.callHackage "aeson-qq" "0.8.4" {};
};
};
srcNoSymlinks = pkgs.runCommand "deref-src" {} ''
mkdir $out
echo $out
mkdir -p $out/example/common/src
mkdir -p $out/example/reflex-gadt-api
cp -r ${./.}/* $out/example/reflex-gadt-api/
cat ${./Readme.md} > $out/example/common/src/Readme.lhs
${pkgs.gnused}/bin/sed \
's~reflex-gadt-api = ./. + \"/../\"~reflex-gadt-api = ./reflex-gadt-api~g' \
${./example/default.nix} > $out/example/default.nix
mkdir -p $out/example/.obelisk/impl
cp ${./example/.obelisk/impl/default.nix} $out/example/.obelisk/impl/default.nix
${pkgs.rsync}/bin/rsync -arv --exclude='Readme.lhs' --exclude='default.nix' ${./example}/ $out/example/
'';
in
{ example = (import (srcNoSymlinks + "/example") {}).exe;
package = ghc.callCabal2nix "reflex-gadt-api" (builtins.fetchGit ./.) {};
recurseForDerivations = true;
})