JavaLWJGLVulkan/flake.nix
Florian RICHER 0e181376b4 Updates
2025-05-23 13:04:00 +02:00

44 lines
1.4 KiB
Nix

{
description = "LWJGL configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
nixgl = {
# Revert this to community version when https://github.com/nix-community/nixGL/pull/187 is merged
url = "github:phirsch/nixGL/fix-versionMatch";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};
outputs = { nixpkgs, flake-utils, nixgl, ... }:
flake-utils.lib.eachSystem flake-utils.lib.allSystems (system:
let
overlays = [ nixgl.overlay ];
pkgs = import nixpkgs {
inherit system overlays;
config.allowUnfree = true;
};
librairies = with pkgs; [ vulkan-headers vulkan-loader vulkan-validation-layers renderdoc ];
java = pkgs.jdk22;
mkCustomShell = { extraPkgs ? [] }: pkgs.mkShell {
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath librairies;
VK_LAYER_PATH = "${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d:${pkgs.renderdoc}/share/vulkan/implicit_layer.d";
packages = with pkgs; [
java
maven
] ++ extraPkgs;
};
in
{
devShells = {
default = mkCustomShell { extraPkgs = [ pkgs.nixgl.auto.nixVulkanNvidia pkgs.nixgl.nixVulkanMesa ]; };
nixos = mkCustomShell {};
};
});
}