-
Notifications
You must be signed in to change notification settings - Fork 5
/
default.nix
39 lines (31 loc) · 1018 Bytes
/
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
let
defaultSources = import ./nix/sources.nix;
defaultNixpkgs = import defaultSources.nixpkgs {};
in
{ pkgs ? defaultNixpkgs }:
let
src = pkgs.nix-gitignore.gitignoreSource [".git/" "*.nix"] ./.;
generatedNix = pkgs.runCommand "curry-club-default.nix" {}
''
# yeah, because cabal2nix is, like, the worst
cp -r ${src}/* .
cp -r ${builtins.path { path = ./.git; name = "dotgit"; }} .git
${pkgs.cabal2nix}/bin/cabal2nix . > $out
sed -e 's|src = ./.|src = ${src}|' -i $out
'';
hp = pkgs.haskellPackages.override {
overrides = self: super: {
clay = pkgs.haskell.lib.overrideCabal super.clay
(drv: { broken = false; jailbreak = true; });
site = super.callPackage generatedNix {};
siteEnv = with self;
(pkgs.haskell.lib.addBuildTools self.site
[ ghcid cabal-install ]).env;
};
};
in {
_a = abort "don’t build this, use `-A site`";
inherit src;
inherit (hp) site siteEnv;
haskellPackages = hp;
}