Skip to content

Commit

Permalink
linux_dependencies: cleanup NixOS (bevyengine#5086)
Browse files Browse the repository at this point in the history
# Objective

Small cleanup to NixOS dependencies.
Switched `clang` and `lld` to `bintools` because of [this](https://matklad.github.io/2022/03/14/rpath-or-why-lld-doesnt-work-on-nixos.html).
  • Loading branch information
SuperSamus committed Jun 24, 2022
1 parent 33a5f2b commit 3d68094
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions docs/linux_dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,20 @@ Add a `shell.nix` file to the root of the project containing:
with pkgs; mkShell {
nativeBuildInputs = [
pkgconfig
clang lld # To use lld linker
llvmPackages.bintools # To use lld linker
];
buildInputs = [
udev alsaLib vulkan-loader
xlibsWrapper xorg.libXcursor xorg.libXrandr xorg.libXi # To use x11 feature
libxkbcommon wayland # To use wayland feature
];
shellHook = ''export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.lib.makeLibraryPath [
udev alsaLib vulkan-loader
libxkbcommon wayland # To use wayland feature
]}"'';
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
}
```

And enter it by just running `nix-shell`. You should be able compile bevy programs using `cargo` within this nix-shell.
And enter it by just running `nix-shell`. You should be able compile Bevy programs using `cargo run` within this nix-shell. You can do this in one line with `nix-shell --run "cargo run"`.

Note that this template does not add Rust to the environment because there are many ways to do it, each with its pros and cons. For example, to use stable Rust from nixpkgs you can add `cargo` to `nativeBuildInputs`.
Note that this template does not add Rust to the environment because there are many ways to do it. For example, to use stable Rust from nixpkgs you can add `cargo` to `nativeBuildInputs`.

## [OpenSUSE](https://www.opensuse.org/)

Expand Down

0 comments on commit 3d68094

Please sign in to comment.