From 3208f62b4a727e6bf4380b6e386ad3926092998f Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Sun, 22 Dec 2024 23:35:39 +0100 Subject: [PATCH] Fix flake.nix for nixos --- .envrc | 2 +- flake.nix | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.envrc b/.envrc index 2f8e1d3..3550a30 100644 --- a/.envrc +++ b/.envrc @@ -1 +1 @@ -use flake --impure +use flake diff --git a/flake.nix b/flake.nix index 624590d..8386939 100644 --- a/flake.nix +++ b/flake.nix @@ -30,6 +30,13 @@ cargo = rust; }); + nativeBuildInputs = with pkgs; [ + (rust.override { extensions = ["rust-src" "rust-analyzer"]; }) + pkg-config + cmake + python312 + ]; + libs = with pkgs; [ vulkan-headers vulkan-loader vulkan-validation-layers ] ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux (with pkgs; [ libxkbcommon wayland libGL ]) ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isDarwin (with pkgs; [ darwin.apple_sdk.frameworks.SystemConfiguration ]); @@ -37,10 +44,15 @@ { devShells = { default = pkgs.mkShell { - nativeBuildInputs = with pkgs; [ - (rust.override { extensions = ["rust-src" "rust-analyzer"]; }) - pkg-config - ]; + inherit nativeBuildInputs; + + buildInputs = libs; + + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (with pkgs; [ libxkbcommon wayland libGL ]); + }; + + with_compatibility = pkgs.mkShell { + inherit nativeBuildInputs; buildInputs = libs ++ [ pkgs.nixgl.auto.nixVulkanNvidia pkgs.nixgl.nixVulkanIntel