-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
shell.nix
51 lines (47 loc) · 1.49 KB
/
shell.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
{ compiler ? "",
nixpkgs ? (import <nixpkgs> {}).fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
rev = "31cd1b4afbaf0b1e81272ee9c31d1ab606503aed";
sha256 = "1hd48vkdrj8rgihrkjfhr3amqlf3phjshqyylslb836n6vlp18pp";
}}:
with import nixpkgs {};
let
# For the documentation tools we use an older Nixpkgs since the
# newer versions seem to be not working great...
old-nixpkgs-src = fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
rev = "d0d905668c010b65795b57afdf7f0360aac6245b";
sha256 = "1kqxfmsik1s1jsmim20n5l4kq6wq8743h5h17igfxxbbwwqry88l";
};
old-nixpkgs = import old-nixpkgs-src {};
docs = import ./nix/docs.nix { nixpkgs = old-nixpkgs-src; };
compiler-pkg = if compiler != ""
then pkgs.${compiler}
else stdenv.cc;
the-stdenv = if compiler-pkg.isClang
then clangStdenv
else stdenv;
in
the-stdenv.mkDerivation rec {
name = "zug-env";
buildInputs = [
cmake
boost
catch2
ccache
old-nixpkgs.doxygen
(old-nixpkgs.python.withPackages (ps: [
ps.sphinx
docs.breathe
docs.recommonmark
]))
];
shellHook = ''
export ZUG_ROOT=`dirname ${toString ./shell.nix}`
addToSearchPath PATH "$ZUG_ROOT/build"
addToSearchPath PATH "$ZUG_ROOT/build/example"
addToSearchPath PATH "$ZUG_ROOT/build/test"
'';
}