forked from typelead/eta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
26 lines (22 loc) · 1.01 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
with import <nixpkgs> { };
let
rootName = name: builtins.elemAt (lib.splitString "/" name) 0;
isValidFile = name: files: builtins.elem (rootName name) files;
relative = path: name: lib.removePrefix (toString path + "/") name;
onlyFiles = files: path: builtins.filterSource (name: type: isValidFile (relative path name) files) path;
eta-nix = fetchTarball "https://github.com/eta-lang/eta-nix/archive/2ec126d2caaa4636faeb4acd07f9143169bc5631.tar.gz";
overrides = self: super: {
mkDerivation = args: super.mkDerivation (lib.overrideExisting args {
src = if args.src.url == "https://github.com/typelead/eta.git" then ./. else args.src;
});
eta = haskell.lib.overrideCabal super.eta (drv: {
# Makes the build a bit faster
src = onlyFiles ["compiler" "include" "eta" "eta.cabal" "LICENSE" "tests"] drv.src;
});
};
eta = import eta-nix { inherit pkgs overrides; };
etaPackages = callPackage "${eta-nix}/eta-modules" { etaHaskellPackages = eta; };
in
eta // {
inherit etaPackages;
}