Skip to content

Commit

Permalink
Add NixOS shell
Browse files Browse the repository at this point in the history
  • Loading branch information
niklaskorz committed Jun 30, 2024
1 parent 02de2b9 commit cbdf166
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
/public/linon.js

.DS_Store
.direnv/
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@ getrandom = { version = "0.2", features = ["js"] }
egui = { git = "https://github.com/emilk/egui.git", rev = "ded8dbd45bc8616475c364878f6b8e2f7293d12c" }
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "ded8dbd45bc8616475c364878f6b8e2f7293d12c" }
egui-winit = { git = "https://github.com/emilk/egui.git", rev = "ded8dbd45bc8616475c364878f6b8e2f7293d12c" }
#ac-ffmpeg = { path = "../../rust-ac-ffmpeg" }
28 changes: 28 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Based on https://github.com/gfx-rs/wgpu/blob/trunk/shell.nix

{ pkgs ? import <nixpkgs> { } }:

pkgs.mkShell rec {
buildInputs = with pkgs; [
libxkbcommon
wayland
xorg.libX11
xorg.libXcursor
xorg.libXrandr
xorg.libXi
pkg-config
cmake

libGL
vulkan-headers
vulkan-loader
vulkan-tools
vulkan-tools-lunarg
vulkan-extension-layer
vulkan-validation-layers
];

shellHook = ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${builtins.toString (pkgs.lib.makeLibraryPath buildInputs)}";
'';
}
2 changes: 1 addition & 1 deletion src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl<'a> Application<'a> {
pub async fn new(window: &'a Window) -> Result<Self> {
let size = window.inner_size();
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: wgpu::Backends::PRIMARY,
backends: wgpu::Backends::all(),
..Default::default()
});
let surface = instance.create_surface(window)?;
Expand Down

0 comments on commit cbdf166

Please sign in to comment.