Open racagogi opened 2 weeks ago
For NixOS users who use nixos-unstable branch, you might need to use rust-overlay since current nixpkgs version is 1.82.0.
module.nix
{ inputs, ... }: { nixpkgs.overlays = [ inputs.rust-overlay.overlays.default
(final: prev: {
kime = prev.callPackage ./package.nix {
inherit (final) rust-bin;
};
})
]; }
> package.nix
```diff
diff --git a/package.nix b/package.nix
index 6d7759a..ac93671 100644
--- a/package.nix
+++ b/package.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, rustPlatform, rustc, cargo, fetchFromGitHub, pkg-config, cmake, extra-cmake-modules
+{ lib, stdenv, rustPlatform, fetchFromGitHub, pkg-config, cmake, extra-cmake-modules, rust-bin, makeRustPlatform
, withWayland ? true
, withIndicator ? true, dbus, libdbusmenu
, withXim ? true, xorg, cairo
@@ -15,6 +15,12 @@ let
++ lib.optionals withQt6 ["-DENABLE_QT6=ON"];
optFlag = w: (if w then "1" else "0");
+
+ rust181 = rust-bin.stable."1.81.0".default;
+ customRustPlatform = makeRustPlatform {
+ cargo = rust181;
+ rustc = rust181;
+ };
in
stdenv.mkDerivation (finalAttrs: {
pname = "kime";
@@ -97,10 +103,9 @@ stdenv.mkDerivation (finalAttrs: {
pkg-config
cmake
extra-cmake-modules
- rustPlatform.bindgenHook
- rustPlatform.cargoSetupHook
- rustc
- cargo
+ customRustPlatform.bindgenHook
+ customRustPlatform.cargoSetupHook
+ rust181
];
RUST_BACKTRACE = 1;
Are there any ways to fix it?
Seems like this is caused by rust-lang/rust#128370
This error occurs with rustc >= 1.82, but succeeds with version 1.81. can add
rust-toolchain.toml
?