vk-book/flake.nix
2025-05-23 21:13:53 -04:00

77 lines
1.7 KiB
Nix

{
description = "3D Graphics Rendering Cookbook project setup";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
...
} @ inputs:
inputs.utils.lib.eachSystem [
"x86_64-linux"
"i686-linux"
"aarch64-linux"
"x86_64-darwin"
] (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [];
};
# Project management scripts
projectScripts = pkgs.writeShellScriptBin "vk" (builtins.readFile ./vk.sh);
in {
devShells.default = pkgs.mkShell.override {stdenv = pkgs.clangStdenv;} rec {
name = "vulkan-graphics-cookbook";
LD_LIBRARY_PATH = with pkgs;
lib.makeLibraryPath [
wayland
libxkbcommon
libffi
xorg.libX11
xorg.libXrandr
xorg.libXinerama
xorg.libXcursor
xorg.libXi
];
packages = with pkgs; [
cmake
wayland-scanner
pkg-config
wayland
libxkbcommon
libffi
xorg.libX11
xorg.libXrandr
xorg.libXinerama
xorg.libXcursor
xorg.libXi
vulkan-tools
vulkan-headers
vulkan-loader
vulkan-validation-layers
libglvnd
tbb
python3
ninja
# Add our project management scripts
projectScripts
];
shellHook = ''
echo "Vulkan Graphics Cookbook Development Environment"
echo "Run 'vk help' for available commands"
'';
};
});
}