From f47df1eebf758c8cf9966f38a1d0dc76dacdf53d Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Mon, 9 Mar 2026 19:08:31 -0400 Subject: [PATCH] build(nix): use LLVM-based stdenv Since we use so much LLVM-based tooling, might as well use it for the main compiler This also allows for a bit of parity with our Debian-based development container Signed-off-by: Seth Flynn --- flake.nix | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/flake.nix b/flake.nix index 6594db522..6e0fa5844 100644 --- a/flake.nix +++ b/flake.nix @@ -86,6 +86,7 @@ let pkgs = nixpkgsFor.${system}; llvm = pkgs.llvmPackages_19; + mkShell = pkgs.mkShell.override { inherit (llvm) stdenv; }; packages' = self.packages.${system}; @@ -131,7 +132,7 @@ in { - default = pkgs.mkShell { + default = mkShell { name = "prism-launcher"; inputsFrom = [ packages'.prismlauncher-unwrapped ]; @@ -139,10 +140,11 @@ packages = with pkgs; [ ccache llvm.clang-tools + python3 # Required for `run-clang-tidy`, etc. ]; cmakeBuildType = "Debug"; - cmakeFlags = [ "-GNinja" ] ++ packages'.prismlauncher.cmakeFlags; + cmakeFlags = [ "-GNinja" ] ++ packages'.prismlauncher-unwrapped.cmakeFlags; dontFixCmake = true; shellHook = '' @@ -165,16 +167,24 @@ formatter = forAllSystems (system: nixpkgsFor.${system}.nixfmt-rfc-style); - overlays.default = final: prev: { - prismlauncher-unwrapped = prev.callPackage ./nix/unwrapped.nix { - inherit - libnbtplusplus - self - ; - }; + overlays.default = + final: prev: - prismlauncher = final.callPackage ./nix/wrapper.nix { }; - }; + let + llvm = final.llvmPackages_19 or prev.llvmPackages_19; + in + + { + prismlauncher-unwrapped = prev.callPackage ./nix/unwrapped.nix { + inherit (llvm) stdenv; + inherit + libnbtplusplus + self + ; + }; + + prismlauncher = final.callPackage ./nix/wrapper.nix { }; + }; packages = forAllSystems ( system: