-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
65 lines (65 loc) · 1.54 KB
/
shell.nix
File metadata and controls
65 lines (65 loc) · 1.54 KB
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
60
61
62
63
64
65
{
pkgs ? import <nixpkgs> { },
}:
let
overrides = (builtins.fromTOML (builtins.readFile ./rust-toolchain.toml));
in
pkgs.callPackage (
{
stdenv,
mkShell,
rustup,
rustPlatform,
}:
mkShell {
strictDeps = true;
nativeBuildInputs = [
rustup
rustPlatform.bindgenHook
] ++ [
pkgs.python3
pkgs.libGL
pkgs.libGLU
# (pkgs.jetbrains.plugins.addPlugins pkgs.jetbrains.rust-rover ["github-copilot"])
(pkgs.vscode.fhsWithPackages (ps: with ps; [ rustup zlib openssl.dev pkg-config ]))
] ++ [
pkgs.xorg.libxcb
pkgs.xorg.libXcursor
pkgs.xorg.libXrandr
pkgs.xorg.libXi
pkgs.pkg-config
];
# libraries here
buildInputs =
with pkgs; [
rustc
cargo
rustfmt
rust-analyzer
clippy
# jetbrains.rust-rover
vscode.fhs
xorg.libX11
wayland
libxkbcommon
trunk
];
RUSTC_VERSION = overrides.toolchain.channel;
# https://github.com/rust-lang/rust-bindgen#environment-variables
shellHook = ''
export PATH="''${CARGO_HOME:-~/.cargo}/bin":"$PATH"
export PATH="''${RUSTUP_HOME:-~/.rustup}/toolchains/$RUSTC_VERSION-${stdenv.hostPlatform.rust.rustcTarget}/bin":"$PATH"
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath [
"/run/opengl-driver"
"/run/opengl-driver-32"
pkgs.libGL
pkgs.libGLU
pkgs.vulkan-loader
pkgs.egl-wayland
pkgs.wayland
pkgs.libxkbcommon
pkgs.xorg.libXcursor
]}:$LD_LIBRARY_PATH"
'';
}
) { }