Skip to content

microsoft/surface: update kernel versions#1696

Open
8bitbuddhist wants to merge 1 commit intoNixOS:masterfrom
8bitbuddhist:surface-kernel-6.18
Open

microsoft/surface: update kernel versions#1696
8bitbuddhist wants to merge 1 commit intoNixOS:masterfrom
8bitbuddhist:surface-kernel-6.18

Conversation

@8bitbuddhist
Copy link
Contributor

@8bitbuddhist 8bitbuddhist commented Dec 6, 2025

Description of changes

Includes the following changes:

  • Update the stable kernel to 6.18.5
  • Update the LTS kernel to 6.12.65

This previously included a patch for older kernel versions so they can build using Rust 1.91, which fixed #1685. The latest kernel releases include this fix, so this is no longer necessary.

Things done
  • Tested the changes in your own NixOS Configuration
  • Tested the changes end-to-end by using your fork of nixos-hardware and
    importing it via <nixos-hardware> or Flake input

@8bitbuddhist
Copy link
Contributor Author

8bitbuddhist commented Dec 7, 2025

It works! :D

No weird crashes, no weird behaviors, no problems shutting down or rebooting.

The only problem is patch 3: in the original patch, line 366 causes the kernel build to fail and I have no idea why. I worked around this by deleting this chunk and just using the value it would've been set to. If that wasn't the case, the 6.17 patches would work without any modification.

I also tried pulling in this camera patch for SP 9, but the patch fails in a bunch of places. I'll play with it when I have some more time.

image

@matthiasdotsh
Copy link
Contributor

Just tested this on my machine with zfs-2.4.0-rc5 (zfs_unstable) and it works!

So nice, that we no longer depend on a release in the linux-surface repository!

@8bitbuddhist 8bitbuddhist changed the title (WIP) microsoft/surface: kernel 6.18 microsoft/surface: kernel 6.18 Dec 16, 2025
@8bitbuddhist 8bitbuddhist marked this pull request as ready for review December 16, 2025 15:49
@Yeshey
Copy link

Yeshey commented Dec 21, 2025

Tested and working on Surface Pro 7. This was the only microsoft surface kernel that allowed me to upgrade to nixOS 25.11, using the rust patch kernel was failing because of bcacheFS for me 🙏

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/linux-surface-kernel-stuck-at-6-12-19/73891/4

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/linux-surface-kernel-stuck-at-6-12-19/73891/5

@TwoUnderscorez
Copy link

Seems to work on my Surface Pro 7+ with the type cover and the pen.

@8bitbuddhist
Copy link
Contributor Author

Merged changes from PR #1690 into here and updated the LTS kernel to 6.12.65

@8bitbuddhist 8bitbuddhist changed the title microsoft/surface: kernel 6.18 microsoft/surface: update kernel versions and fix rust Jan 17, 2026
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/linux-surface-kernel-stuck-at-6-12-19/73891/8

@Majiir

This comment was marked as resolved.

@starmaid
Copy link

looks like the 6.12.65 kernel already has those changes for generate_rust_target.rs

@Majiir
Copy link
Contributor

Majiir commented Jan 19, 2026

Posting this from a Surface 3 Pro running Linux 6.12.65 using this patch.

@pgattic
Copy link

pgattic commented Jan 22, 2026

Works for me! The kernel built in about 3 hours on my surface pro 4

@Walavouchey
Copy link

posting from a surface pro 8! been using for a few days already with no issues

@FaceFTW
Copy link

FaceFTW commented Jan 24, 2026

Been running this on a Surface Laptop Studio 1st gen. No issues either

@8bitbuddhist
Copy link
Contributor Author

According to the contributor guide, anyone who is a contributor to nixpkgs can review and approve PRs. So if there are any nixpkgs contributors in this thread, 🆘 😅

https://github.com/NixOS/nixos-hardware/blob/master/CONTRIBUTING.md#for-reviewers

@AwesomeQubic
Copy link
Member

AwesomeQubic commented Jan 27, 2026

A option to disable redundant kernel modules would be nice. Since linux-surface users run on surface laptops not compiling modules for hardware that well surface does not contain might speed up complies.

@aliaslion
Copy link

Maybe you can mkForce boot.kernelModules? (I'm guessing boot.extraModulePackages doesn't affect compilation)

@matthiasdotsh
Copy link
Contributor

FYI: Building 6.18.5 fails on nixpkgs-unstable (bfc1b8a4574108ceef22f02bafcf6611380c100d).
6.18.7 builds fine.

diff --git a/microsoft/surface/common/default.nix b/microsoft/surface/common/default.nix
index d4e4ade..61d659b 100644
--- a/microsoft/surface/common/default.nix
+++ b/microsoft/surface/common/default.nix
@@ -19,7 +19,7 @@ let
     if kernelVersion == "longterm" then
       "6.12.65"
     else if kernelVersion == "stable" then
-      "6.18.5"
+      "6.18.7"
     else
       abort "Invalid kernel version: ${kernelVersion}";
 
@@ -28,7 +28,7 @@ let
     if kernelVersion == "longterm" then
       "sha256-VOhSZnrzXA7QbPyBMR5l+n9feYo7/PeKVZ07R4WhOcE="
     else if kernelVersion == "stable" then
-      "sha256-GJ0fQJzvjQ0jQhDgRZUXLfOS+MspfhS0R+2Vcg4v2UA="
+      "sha256-tyak0Vz5rgYhm1bYeCB3bjTYn7wTflX7VKm5wwFbjx4="
     else
       abort "Invalid kernel version: ${kernelVersion}";

@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Jan 30, 2026

I cannot squash merge this, so please clean up the history a bit and squash most things into one or two commits, please.

@8bitbuddhist
Copy link
Contributor Author

I cannot squash merge this, so please clean up the history a bit and squash most things into one or two commits, please.

I haven't fully figured out rebasing yet, so if this ends up being too big a mess, I might create a new branch and cherry-pick onto it. Gonna give it a good try though

@8bitbuddhist 8bitbuddhist force-pushed the surface-kernel-6.18 branch 2 times, most recently from 4115e31 to f0c0b7d Compare January 30, 2026 16:23
@8bitbuddhist
Copy link
Contributor Author

@SuperSandro2000 Should be good to go after the tests finish 👍🏾

@8bitbuddhist 8bitbuddhist changed the title microsoft/surface: update kernel versions and fix rust microsoft/surface: update kernel versions Jan 31, 2026
@tmarkov
Copy link

tmarkov commented Feb 1, 2026

BTW, isn't 6.18 itself the newest LTS?

@8bitbuddhist
Copy link
Contributor Author

BTW, isn't 6.18 itself the newest LTS?

Technically yes, but this is available as a fallback in case folks are using kernel modules that haven't been updated yet, or there's some other reason keeping them from using the newer kernel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

error loading target specification: target-pointer-width: invalid type: string "64", expected u16 at line 8 column 32