-
Notifications
You must be signed in to change notification settings - Fork 2
/
default.nix
44 lines (40 loc) · 1.48 KB
/
default.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
38
39
40
41
42
43
44
{ rev ? "7c6985653708c5fade76d2014824ff333b0a07b2"
, overlays ? [ (import ./overlay.nix) ]
, pkgs ?
if ((rev == "") || (rev == "default") || (rev == "local"))
then import <nixpkgs> { inherit overlays; }
# Do not guard with hash, so the project is able to use current channels (rolling `rev`) of Nixpkgs
else import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz") { inherit overlays; }
}:
let
src = pkgs.nix-gitignore.gitignoreSource [ ] ./.;
myGhc = pkgs.haskellPackages.ghcWithPackages (ps: with pkgs.haskellPackages; [
implicit
linear
]);
pkg =
#pkgs.haskell.lib.buildFromSdist (
#pkgs.haskell.lib.justStaticExecutables (
pkgs.haskellPackages.callCabal2nix "implicitpipe" src {}
#)
#)
;
in
{
passthru = { inherit pkg; };
# based on https://github.com/haskell-hint/hint/issues/79
wrapper = pkgs.stdenv.mkDerivation {
name = "implicitpipe-wrapped";
unpackPhase = "true";
buildInputs = [ myGhc pkg pkgs.makeWrapper ];
buildPhase = ''
# We need to provide the Haskell interpreter (hint) with the location of the ghc lib dir and the package db
mkdir -p $out/bin
ln -s ${pkg}/bin/implicitanim $out/bin/implicitanim
ln -s ${pkg}/bin/implicitview $out/bin/implicitview
wrapProgram $out/bin/implicitview \
--set GHC_PACKAGE_PATH "${myGhc}/lib/${myGhc.meta.name}/package.conf.d"
'';
installPhase = "echo nothing to install";
};
}