-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
55 lines (55 loc) · 1.77 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
45
46
47
48
49
50
51
52
53
54
55
{
nixpkgs ? import <nixpkgs> {},
haskell-tools ? import (builtins.fetchTarball "https://github.com/danwdart/haskell-tools/archive/master.tar.gz") {
nixpkgs = nixpkgs;
compiler = compiler;
},
compiler ? "ghc910"
}:
let
pkgsForX86 = if builtins.currentSystem == "x86_64-linux" then nixpkgs else nixpkgs.pkgsCross.gnu64.pkgsBuildHost;
pkgsX86 = if builtins.currentSystem == "x86_64-linux" then nixpkgs else nixpkgs.pkgsCross.gnu64.pkgsHostHost;
gitignore = nixpkgs.nix-gitignore.gitignoreSourcePure [ ./.gitignore ];
tools = haskell-tools compiler;
lib = pkgsX86.haskell.lib;
myHaskellPackages = pkgsX86.haskell.packages.${compiler}.override {
overrides = self: super: rec {
openfaas = lib.dontHaddock (self.callCabal2nix "openfaas" (gitignore ./.) {});
# Tests for aeson don't work because they should be run as host
# "Couldn't find a target code interpreter. Try with -fexternal-interpreter"
aeson = if builtins.currentSystem == "x86_64-linux" then super.aeson else lib.dontCheck super.aeson;
};
};
shell = myHaskellPackages.shellFor {
packages = p: [
p.openfaas
];
shellHook = ''
gen-hie > hie.yaml
for i in $(find -type f | grep -v dist-newstyle); do krank $i; done
cabal update
'';
buildInputs = tools.defaultBuildTools ++ (with nixpkgs; [
nodejs_20
closurecompiler
pkgsForX86.cabal-install
pkgsForX86.gcc
pkgsX86.gmp
pkgsX86.libffi
pkgsX86.glibc
]);
nativeBuildInputs = tools.defaultBuildTools ++ (with nixpkgs; [
nodejs_20
closurecompiler
pkgsForX86.cabal-install
pkgsForX86.gcc
pkgsX86.gmp
pkgsX86.libffi
pkgsX86.glibc
]);
withHoogle = false;
};
in
{
inherit shell;
}