diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index 0f7606c79b53..4bbebf2cc3b4 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -43,7 +43,10 @@ let ); forceRust = features.rust or false; - kernelSupportsRust = lib.versionAtLeast version "6.7"; + kernelSupportsRust = lib.versionAtLeast version "6.7" + # Known to be broken: https://lore.kernel.org/lkml/31885EDD-EF6D-4EF1-94CA-276BA7A340B7@kernel.org/T/ + && !(stdenv.hostPlatform.isRiscV && stdenv.cc.isGNU); + # Currently only enabling Rust by default on kernel 6.12+, # which actually has features that use Rust that we want. diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index fe6b1b8f0f98..334e76efb60a 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -109,11 +109,7 @@ let commonStructuredConfig = import ./common-config.nix { inherit lib stdenv version; - rustAvailable = - lib.any (lib.meta.platformMatch stdenv.hostPlatform) rustc.targetPlatforms - && lib.all (p: !lib.meta.platformMatch stdenv.hostPlatform p) rustc.badTargetPlatforms - # Known to be broken: https://lore.kernel.org/lkml/31885EDD-EF6D-4EF1-94CA-276BA7A340B7@kernel.org/T/ - && !(stdenv.hostPlatform.isRiscV && stdenv.cc.isGNU); + rustAvailable = lib.meta.availableOn stdenv.hostPlatform rustc; features = kernelFeatures; # Ensure we know of all extra patches, etc. };