ptk/flake.nix

52 lines
1.3 KiB
Nix
Raw Normal View History

2024-08-08 14:38:43 +02:00
{
description = "poz toolkit";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
};
outputs = {self, nixpkgs, ...}: let
name = "ptk";
systems = ["x86_64-linux" "aarch64-linux"];
forEachSystem = nixpkgs.lib.genAttrs systems;
pkgsForEach = nixpkgs.legacyPackages;
in {
devShells = forEachSystem (
system: let
pkgs = pkgsForEach.${system};
shell = pkgs.mkShell {
name = "ptk";
packages = with pkgs; [
bear
gdb
vulkan-tools
spirv-tools
mesa-demos
];
inputsFrom = [ self.packages.${system}.default ];
# https://discourse.nixos.org/t/setting-up-vulkan-for-development/11715/3
LD_LIBRARY_PATH = with pkgs; "${glfw}/lib:${vulkan-loader}/lib:${vulkan-validation-layers}/lib:./target";
VULKAN_SDK = with pkgs; "${vulkan-headers}";
VK_LAYER_PATH = with pkgs; "${vulkan-validation-layers}/share/vulkan/explicit_layer.d";
};
in {
"${name}" = shell;
default = shell;
}
);
packages = forEachSystem (
system: let
pkgs = pkgsForEach.${system};
package = pkgs.callPackage ./nix/default.nix {};
in {
"${name}" = package;
default = package;
}
);
};
}