Orginisation for building later

Development
Johannes Hendrik Gerard van der Weide 2024-01-16 13:31:18 +01:00
parent d1d0eac44d
commit 4ea9cdf612
2 changed files with 48 additions and 45 deletions

View File

@ -39,51 +39,7 @@
{
# Development environment output
devShells = forAllSystems ({ pkgs }: {
default = pkgs.mkShell {
# The Nix packages provided in the environment
packages = (with pkgs; [
# Fluff
cargo-mommy
onefetch
# Bevy
pkg-config
alsa-lib
vulkan-tools
vulkan-headers
vulkan-loader
vulkan-validation-layers
udev
clang
lld
# If using an intel GPU
pkgs.nixgl.nixVulkanIntel
# If on x11
xorg.libX11
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
# If on wayland
libxkbcommon
wayland
# Rust
rustup
rustToolchain
]) ++ pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs; [ libiconv ]);
shellHook = ''
# Required
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.lib.makeLibraryPath [
pkgs.alsaLib
pkgs.udev
pkgs.vulkan-loader
]}"
# Aliases and other fluff/ease of use
alias runIntel="nixVulkanIntel cargo run"
alias runMommyIntel="nixVulkanIntel cargo mommy run"
onefetch
echo "Welcome to nix-hell uh nix-shell!"
'';
};
default = import ./nix/shell.nix { inherit pkgs; };
});
};
}

47
nix/shell.nix Normal file
View File

@ -0,0 +1,47 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
# The Nix packages provided in the environment
packages = (with pkgs; [
# Fluff
cargo-mommy
onefetch
# Bevy
pkg-config
alsa-lib
vulkan-tools
vulkan-headers
vulkan-loader
vulkan-validation-layers
udev
clang
lld
# If using an intel GPU
pkgs.nixgl.nixVulkanIntel
# If on x11
xorg.libX11
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
# If on wayland
libxkbcommon
wayland
# Rust
rustup
rustToolchain
]) ++ pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs; [ libiconv ]);
shellHook = ''
# Required
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.lib.makeLibraryPath [
pkgs.alsaLib
pkgs.udev
pkgs.vulkan-loader
]}"
# Aliases and other fluff/ease of use
alias runIntel="nixVulkanIntel cargo run"
alias runMommyIntel="nixVulkanIntel cargo mommy run"
onefetch
echo "Welcome to nix-hell uh nix-shell!"
'';
}