aboutsummaryrefslogtreecommitdiff
path: root/shell/rust.nix
blob: 1e9c2f2cc7fd0f60e713e4b4adf6b86da8d5078d (plain) (blame)
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
# with import <nixpkgs> { };
# let
#   src = fetchFromGitHub {
#     owner = "mozilla";
#     repo = "nixpkgs-mozilla";
#     rev = "15b7a05f20aab51c4ffbefddb1b448e862dccb7d"; # 10th April 2022
#     sha256 = "sha256-YeN4bpPvHkVOpQzb8APTAfE7/R+MFMwJUMkqmfvytSk=";
#   };
#   moz = import "${src.out}/rust-overlay.nix" pkgs pkgs;
#   rust = moz.latest.rustChannels.nightly.rust.override {
#     extensions = [ "rust-src" ];
#   };
# in
# mkShell rec {
#   buildInputs = [
#     # Build tools
#     rust
#
#     # Lib deps
#     pkg-config
#     libclang
#   ];
#   nativeBuildInputs = [ clang ];
#
#   # RUST_SRC_PATH = rust.packages.stable.rustPlatform.rustLibSrc;
#   # RUST_BACKTRACE = 1;
#   LIBCLANG_PATH = "${libclang.lib}/lib";
#   LD_LIBRARY_PATH = lib.makeLibraryPath (buildInputs ++ nativeBuildInputs);
# }

with import <nixpkgs> { };
mkShell rec {
  buildInputs = [
    # Build tools
    rustup
    pkg-config

    # Deps
    libclang

    # Dev
    nodePackages.nodemon
    rust-analyzer
  ];
  nativeBuildInputs = [ clang ];

  LIBCLANG_PATH = "${libclang.lib}/lib";
  RUST_SRC_PATH = rust.packages.stable.rustPlatform.rustLibSrc;
  LD_LIBRARY_PATH = lib.makeLibraryPath (buildInputs ++ nativeBuildInputs);
}