Skip to content

Commit

Permalink
add flake for vulkan dev (host)
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-m committed Oct 10, 2024
1 parent 39a713d commit 23a0990
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 0 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/build/
/prof-*.gz
/env
/.direnv

/internal/pkg/stitch/*.jpg
/internal/pkg/stitch/*.MISSING
Expand Down
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
};

outputs = {
self,
nixpkgs,
} @ inputs: let
lib = nixpkgs.lib;
system = "x86_64-linux";
pkgs = import inputs.nixpkgs {
system = system;
};
in {
formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra;

devShells.${system}.default = pkgs.mkShell rec {
nativeBuildInputs = with pkgs; [];
packages = with pkgs; [];

buildInputs = with pkgs; [
# Build tools
gcc
pkg-config
clang-tools
gnumake
curl
go

# Cross
pkgsCross.aarch64-multiplatform.buildPackages.gcc # Provides aarch64-unknown-linux-gnu-gcc

# Vulkan bare tools and depencencies
glslang
vulkan-headers
vulkan-loader
vulkan-validation-layers

# More Vulkan tools
vulkan-extension-layer
vulkan-tools
vulkan-tools-lunarg
vulkan-volk
];

LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}";
VK_LAYER_PATH = "${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d";
VULKAN_SDK = "${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d";
XDG_DATA_DIRS = builtins.getEnv "XDG_DATA_DIRS";
XDG_RUNTIME_DIR = "/run/user/1000";
};
};
}

0 comments on commit 23a0990

Please sign in to comment.