From a2332a5048ffb7bf07632f4beb2e320727ab64cf Mon Sep 17 00:00:00 2001 From: Hunter Date: Thu, 4 Dec 2025 17:12:13 -0500 Subject: [PATCH] rust patch --- hosts/hacks/rust-fix.patch | 12 ++++++++++++ hosts/nix-surface.nix | 13 ++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 hosts/hacks/rust-fix.patch diff --git a/hosts/hacks/rust-fix.patch b/hosts/hacks/rust-fix.patch new file mode 100644 index 0000000..fd4db48 --- /dev/null +++ b/hosts/hacks/rust-fix.patch @@ -0,0 +1,12 @@ +diff --recursive -u linux-6.15.9.orig/scripts/generate_rust_target.rs linux-6.15.9/scripts/generate_rust_target.rs +--- linux-6.15.9.orig/scripts/generate_rust_target.rs 2025-08-01 10:51:29.000000000 +0200 ++++ linux-6.15.9/scripts/generate_rust_target.rs 2025-11-29 12:30:54.792372738 +0100 +@@ -225,7 +225,7 @@ + ts.push("features", features); + ts.push("llvm-target", "x86_64-linux-gnu"); + ts.push("supported-sanitizers", ["kcfi", "kernel-address"]); +- ts.push("target-pointer-width", "64"); ++ ts.push("target-pointer-width", 64); + } else if cfg.has("X86_32") { + // This only works on UML, as i386 otherwise needs regparm support in rustc + if !cfg.has("UML") { diff --git a/hosts/nix-surface.nix b/hosts/nix-surface.nix index 3290b1b..b3c5dc8 100644 --- a/hosts/nix-surface.nix +++ b/hosts/nix-surface.nix @@ -16,15 +16,10 @@ "rd.systemd.show_status=auto" ]; - boot.kernelPatches = [ - { - name = "disable-rust"; - patch = null; - extraConfig = '' - RUST n - ''; - } - ]; + boot.kernelPatches = [{ + name = "rust-1.91-fix"; + patch = ./hacks/rust-fix.patch; + }]; disko.devices.disk.main.content.partitions.swap.size = "8G"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";