nix: add cpio, qemu and gdb, to finalize the environment-independence
[barrelfish] / default.nix
1 { stdenv, fetchgit, haskell
2
3 , autoconf
4 , automake
5 , binutils
6 , coreutils
7 , cpio
8 , curl
9 , gcc5
10 , gdb
11 , git
12 , gmp
13 , gnugrep
14 , gnused
15 , m4
16 , qemu
17
18 , ghc-version ? "ghc801"
19
20 , propagate-deps ? false
21 , use-repo-source ? false
22 , repo-url ? ""
23 , repo-commit-id ? ""
24 , repo-commit-sha256 ? ""
25 }:
26
27 let src-repo = fetchgit {
28       url    = repo-url;
29       rev    = repo-commit-id;
30       sha256 = repo-commit-sha256;
31     };
32     ghc        = haskell.packages."${ghc-version}".ghcWithPackages
33                      (haskellPackages: with haskellPackages; [
34                         async
35                         bytestring-trie
36                         ghc-paths
37                         ghc-mtl
38                         haskell-src-exts
39                         parsec
40                         random
41                      ]);
42     deps       = [
43         autoconf
44         automake
45         binutils
46         coreutils
47         cpio
48         curl
49         gcc5
50         gdb
51         git
52         gmp
53         gnugrep
54         gnused
55         m4
56         qemu
57
58         # custom GHC
59         ghc
60     ];
61 in
62 stdenv.mkDerivation {
63         version = "2016-11-09";
64         name    = "barrelfish";
65         src     = if use-repo-source
66                   then src-repo
67                   else builtins.filterSource
68                        (path: type: baseNameOf path != ".git" && baseNameOf path != "build")
69                        ./.;
70
71         buildInputs = deps;
72         propagatedBuildInputs = if propagate-deps
73                                 then deps
74                                 else [];
75
76         description = "The Barrelfish OS";
77         license = "MIT";
78 }