-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshell.nix
58 lines (52 loc) · 1.4 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
52
53
54
55
56
57
58
let
# Nixpkgs snapshot.
sources = import ./nix/sources.nix;
# Overlays
oxalica-rust-overlay = import sources.rust-overlay;
# Build rust crates.
naersk = final: prev: {
naersk = pkgs.callPackage sources.naersk
{
inherit sources;
};
};
# The final "pkgs" attribute with all the bells and whistles of our overlays.
pkgs = import sources.nixpkgs {
overlays = [
oxalica-rust-overlay
naersk
];
};
darwin-cargo-build-rustflags = pkgs.lib.attrsets.optionalAttrs pkgs.stdenv.isDarwin {
CARGO_BUILD_RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup";
};
in
# This is our development shell.
pkgs.mkShell ({
buildInputs = [
# Haskell
pkgs.haskell.compiler.ghc982
pkgs.cabal-install
# Haskell libs need zlib.
pkgs.zlib
# Rust
# For now just run `gen-js` from inside the `nix-shell` in order to install
# Rust via rustup and to eventually generate the WASM code from Rust
# ("rust-js/js/rust_js_bg.wasm" and "rust-js/js/rust_js.js").
#pkgs.rust-bin.stable.latest.default
pkgs.rustup
pkgs.wasm-pack
# For updating Nix dependencies.
pkgs.niv
# Misc
pkgs.git
pkgs.less
]
# For file_system on macOS.
++ pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
Cocoa
CoreFoundation
CoreServices
Security
]);
} // darwin-cargo-build-rustflags)