You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Objective
I can't build a project using bevy under the environment of NixOS, so I
have to create flake.nix file.
## Solution
I add flake.nix example to `linux_dependencies.md`.
## Testing
I checked my NixOS environment in a project using bevy and booted the
project's game successfully.
---
## Showcase
<details>
<summary>Click to view showcase</summary>
1. Create a GitHub project using bevy.
2. Add a flake.nix file.
3. Commit to add this file to the GitHub repository.
4. Run `nix develop`
</details>
---------
Co-authored-by: nukanoto <[email protected]>
Co-authored-by: Alice Cecile <[email protected]>
Co-authored-by: Ilia <[email protected]>
> We have confirmed that this flake.nix can be used successfully on NixOS and MacOS with Rust's edition set to 2021.
184
+
185
+
### shell.nix
186
+
113
187
Add a `shell.nix` file to the root of the project containing:
114
188
115
189
```nix
@@ -138,8 +212,8 @@ If running nix on a non NixOS system (such as ubuntu, arch etc.), [NixGL](https:
138
212
to link graphics drivers into the context of software installed by nix:
139
213
140
214
1. Install a system specific nixGL wrapper ([docs](https://github.com/nix-community/nixGL)).
141
-
* If you're running a nvidia GPU choose `nixVulkanNvidia`.
142
-
* Otherwise, choose another wrapper appropriate for your system.
215
+
- If you're running a nvidia GPU choose `nixVulkanNvidia`.
216
+
- Otherwise, choose another wrapper appropriate for your system.
143
217
2. Run `nixVulkanNvidia-xxx.xxx.xx cargo run` to compile a bevy program, where `xxx-xxx-xx` denotes the graphics driver version `nixVulkanNvidia` was compiled with.
144
218
145
219
This is also possible with [Nix flakes](https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake.html).
@@ -152,7 +226,7 @@ for more information about `devShells`.
152
226
Note that this template does not add Rust to the environment because there are many ways to do it.
153
227
For example, to use stable Rust from nixpkgs, you can add `cargo` and `rustc` to `nativeBuildInputs`.
0 commit comments