forked from windmill-labs/windmill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
59 lines (49 loc) · 1.5 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
59
{ pkgs ? import <nixpkgs> { } }:
/* based on
https://discourse.nixos.org/t/how-can-i-set-up-my-rust-programming-environment/4501/9
*/
let
rust_overlay = import (builtins.fetchTarball
"https://github.com/oxalica/rust-overlay/archive/master.tar.gz");
pkgs = import <nixpkgs> { overlays = [ rust_overlay ]; };
# TODO: Pin version?
rustVersion = "latest";
# rustVersion = "1.83.0";
rust = pkgs.rust-bin.nightly.${rustVersion}.default.override {
extensions = [
"rust-src" # for rust-analyzer
"rust-analyzer"
];
};
in pkgs.mkShell {
packages = with pkgs; [
rust
# rustup
cargo-watch
typescript # tsc
typescript-language-server
postgresql
watchexec # used in client's dev.nu
poetry # for python client
python312Packages.pip-tools # pip-compile
];
# buildInputs = with pkgs; [ xz lzma ];
# Add the following lines to set the LD_LIBRARY_PATH
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath (with pkgs; [
lzma
libseccomp
bzip2
openssl_3_3
#
])}";
REMOTE = "http://127.0.0.1:8000";
REMOTE_LSP = "http://127.0.0.1:3001";
DATABASE_URL =
"postgres://postgres:[email protected]:5432/windmill?sslmode=disable";
RUSTC_LINKER = "${pkgs.clang}/bin/clang";
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER = "${pkgs.clang}/bin/clang";
RUSTFLAGS =
"-C link-arg=-fuse-ld=${pkgs.mold}/bin/mold -Zshare-generics=y -Z threads=4";
RUSTC_WRAPPER = "${pkgs.sccache}/bin/sccache";
# Use mold as a linker (for faster compilation)
}