mirror of
https://github.com/bevyengine/bevy
synced 2024-11-24 13:43:04 +00:00
Docs/more nixos instructions (#2775)
# Objective Expand the documentation for NixOS setups (as discussed in Discord) ## Solution Added more info to `linux_dependencies.md` about NixOS. This is based off my own experience (as documented in [this blog post](https://blog.thomasheartman.com/posts/bevy-getting-started-on-nixos)), so I can't confirm that it'll work for everyone. However, if there are further tweaks necessary, then I think that this should nevertheless work as a good starting point and should give future users an idea of what they may need to change or update. Feedback and tweaks are very welcome 😄
This commit is contained in:
parent
18c08dd860
commit
e317058677
1 changed files with 43 additions and 0 deletions
|
@ -98,6 +98,49 @@ And enter it by just running `nix-shell`.
|
|||
|
||||
You should be able compile bevy programms using `cargo` within this nix-shell.
|
||||
|
||||
### Fast compilation
|
||||
|
||||
According to the Bevy getting started guide (for v0.5), you can enable fast compilation by add a Cargo config file and by adding `lld` and `clang`. As long as you add `clang` and `lld` to your environment, it should mostly work, but you'll still need to modify the Cargo config file so that it doesn't point to `/usr/bin/clang` anymore.
|
||||
|
||||
Working off the above files, let's make the necessary changes.
|
||||
|
||||
For `.cargo/config.toml`, change the path to the linker from `/usr/bin/clang` to `clang`:
|
||||
|
||||
``` diff
|
||||
[target.x86_64-unknown-linux-gnu]
|
||||
- linker = "/usr/bin/clang"
|
||||
+ linker = "clang"
|
||||
rustflags = ["-Clink-arg=-fuse-ld=lld", "-Zshare-generics=y"]
|
||||
```
|
||||
|
||||
In `shell.nix`, add `lld` and `clang`:
|
||||
|
||||
``` diff
|
||||
buildInputs = [
|
||||
cargo
|
||||
pkgconfig udev alsaLib lutris
|
||||
x11 xorg.libXcursor xorg.libXrandr xorg.libXi
|
||||
vulkan-tools vulkan-headers vulkan-loader vulkan-validation-layers
|
||||
+ clang lld
|
||||
];
|
||||
```
|
||||
|
||||
### Building apps and using the GPU
|
||||
|
||||
If you run into issues with building basic apps or activating the GPU ('thread 'main' panicked at 'Unable to find a GPU!'), then you may need to update your environment's `LD_LIBRARY_PATH`. To solve issues relating to missing `libudev.so.1` files, `alsa` drivers, and being unable to find a GPU, try updating the environment variable in your `shell.nix` by creating a `shellHook`:
|
||||
|
||||
``` diff
|
||||
{ pkgs ? import <nixpkgs> { } }:
|
||||
with pkgs;
|
||||
mkShell {
|
||||
+ shellHook = ''export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.lib.makeLibraryPath [
|
||||
+ pkgs.alsaLib
|
||||
+ pkgs.udev
|
||||
+ pkgs.vulkan-loader
|
||||
+ ]}"'';
|
||||
buildInputs = [
|
||||
```
|
||||
|
||||
## Opensuse Tumbleweed
|
||||
|
||||
```bash
|
||||
|
|
Loading…
Reference in a new issue