-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
54 lines (48 loc) · 1.34 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
let
nixpkgsSrc = builtins.fetchGit {
url = "https://github.com/NixOS/nixpkgs.git";
rev = "d5291756487d70bc336e33512a9baf9fa1788faf";
ref = "refs/tags/19.09";
};
pkgs = import (
nixpkgsSrc
) { config.allowUnsupportedSystem = true; };
pkgs' = import ./nix/vscode.nix {inherit pkgs ;}
// import ./nix/purescript.nix {inherit pkgs ;};
ffi-cpp = import ./nix/purescript-ffi.nix {inherit pkgs; };
arduinoSTL = import ./nix/arduinoSTL.nix {inherit pkgs; };
# avr-gcc = import ./nix/avr-gcc.nix {inherit pkgs; };
pname = "purescriptearningbook";
version = "0.0.1";
name = pname + "-" + version;
in
pkgs.stdenv.mkDerivation rec {
inherit version pname name;
buildInputs = with pkgs // pkgs';
[
arduinoSTL
boost
vscode
ffi-cpp
purty
purs
arduino
psc-package
gcc
libpcap
];
shellHook = ''
PATH=$PATH:$PWD/bin
export BOOST=${pkgs.boost}
export ARDUINO_STL=${arduinoSTL}
export BOOST=${pkgs.boost}
export FFI_SRC=$PWD/ffi
export ARDUINO_APLICATIOON=${pkgs.arduino}
mkdir ffi
cp -r "${pkgs.arduino}/share/arduino/hardware/arduino/avr/cores/arduino/" "$FFI_SRC/arduino"
cp -r "${ffi-cpp}/" "$FFI_SRC/purscript"
chmod 777 -R $FFI_SRC
rm -f $FFI_SRC/arduino/hooks.cpp
rm -f $FFI_SRC/arduino/main.cpp
'';
}