From 64f0c12d0a52346ffe0e2208f0c59e9a9806f40d Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 1 Sep 2025 12:17:30 +0000 Subject: [PATCH] Use rust-analyzer from fenix toolchain in flake (#6826) --- flake.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 401eb72c..d7a6cd9c 100644 --- a/flake.nix +++ b/flake.nix @@ -46,11 +46,11 @@ pname = "typst"; version = cargoToml.workspace.package.version; - rust-toolchain = (fenix.packages.${system}.fromManifestFile rust-manifest).defaultToolchain; + rust-toolchain = fenix.packages.${system}.fromManifestFile rust-manifest; # Crane-based Nix flake configuration. # Based on https://github.com/ipetkov/crane/blob/master/examples/trunk-workspace/flake.nix - craneLib = (crane.mkLib pkgs).overrideToolchain rust-toolchain; + craneLib = (crane.mkLib pkgs).overrideToolchain rust-toolchain.defaultToolchain; # Typst files to include in the derivation. # Here we include Rust files, docs and tests. @@ -150,10 +150,13 @@ checks = self'.checks; inputsFrom = [ typst ]; - buildInputs = with pkgs; [ - rust-analyzer + buildInputs = [ + rust-toolchain.rust-analyzer + rust-toolchain.rust-src ]; + RUST_SRC_PATH = "${rust-toolchain.rust-src}/lib/rustlib/src/rust/library"; + packages = [ # A script for quickly running tests. # See https://github.com/typst/typst/blob/main/tests/README.md#making-an-alias