Use nixGl auto detection fork to fix NixOS (open source NVIDIA)
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 36s
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 36s
This commit is contained in:
parent
7ed254f183
commit
34ec2894df
2 changed files with 19 additions and 21 deletions
29
flake.nix
29
flake.nix
|
@ -9,7 +9,8 @@
|
|||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
nixgl = {
|
||||
url = "github:nix-community/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";
|
||||
};
|
||||
|
@ -39,25 +40,21 @@
|
|||
cmake
|
||||
python312
|
||||
];
|
||||
|
||||
mkRustVulkanShell = { nixGLSupport ? true }: pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [
|
||||
(rust.override { extensions = ["rust-src" "rust-analyzer"]; })
|
||||
] ++ nativeBuildInputs;
|
||||
|
||||
buildInputs = buildInputs
|
||||
++ pkgs.lib.optionals nixGLSupport [ pkgs.nixgl.auto.nixVulkanNvidia pkgs.nixgl.nixVulkanIntel ];
|
||||
|
||||
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
|
||||
VK_LAYER_PATH = "${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d";
|
||||
};
|
||||
in
|
||||
{
|
||||
devShells = {
|
||||
default = mkRustVulkanShell {};
|
||||
default = pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [
|
||||
(rust.override { extensions = [ "rust-src" "rust-analyzer" ]; })
|
||||
] ++ nativeBuildInputs;
|
||||
|
||||
# Crash with error: cannot coerce null to a string: null
|
||||
nixos = mkRustVulkanShell { nixGLSupport = false; };
|
||||
buildInputs = buildInputs
|
||||
++ [ pkgs.nixgl.auto.nixVulkanNvidia pkgs.nixgl.nixVulkanMesa ];
|
||||
|
||||
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
|
||||
VK_LAYER_PATH = "${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d";
|
||||
RUST_LOG = "info,rust_vulkan_test=trace";
|
||||
};
|
||||
};
|
||||
|
||||
packages = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue