microsoft/surface: change logic to pull the latest linux-surface for all versions, since we really just need the patches.

This commit is contained in:
Andre 2025-11-23 13:20:08 -05:00
parent 899dc449bc
commit abb5f782d3

View file

@ -32,57 +32,28 @@ let
else else
abort "Invalid kernel version: ${kernelVersion}"; abort "Invalid kernel version: ${kernelVersion}";
# Set the version and hash for the linux-surface releases # Fetch the latest linux-surface patches
pkgVersion = repos = pkgs.callPackage (
with config.hardware.microsoft-surface; { fetchFromGitHub }:
if kernelVersion == "longterm" then {
"6.12.7" linux-surface = fetchFromGitHub {
else if kernelVersion == "stable" then owner = "linux-surface";
"6.15.3" repo = "linux-surface";
else rev = "50d0ed6be462a5fdb643cfe8469bf69158afae42";
abort "Invalid kernel version: ${kernelVersion}"; hash = "sha256-ozvYrZDiVtMkdCcVnNEdlF2Kdw4jivW0aMJrDynN3Hk=";
pkgHash =
with config.hardware.microsoft-surface;
if kernelVersion == "longterm" then
"sha256-Pv7O8D8ma+MPLhYP3HSGQki+Yczp8b7d63qMb6l4+mY="
else if kernelVersion == "stable" then
"sha256-ozvYrZDiVtMkdCcVnNEdlF2Kdw4jivW0aMJrDynN3Hk="
else
abort "Invalid kernel version: ${kernelVersion}";
# Fetch the linux-surface package
repos =
pkgs.callPackage
(
{
fetchFromGitHub,
rev,
hash,
}:
{
linux-surface = fetchFromGitHub {
owner = "linux-surface";
repo = "linux-surface";
rev = rev;
hash = hash;
};
}
)
{
hash = pkgHash;
rev = "arch-${pkgVersion}-1";
}; };
}
) { };
# Fetch and build the kernel package # Fetch and build the kernel
inherit (pkgs.callPackage ./kernel/linux-package.nix { inherit repos; }) inherit (pkgs.callPackage ./kernel/linux-package.nix { inherit repos; })
linuxPackage linuxPackage
surfacePatches surfacePatches
; ;
kernelPatches = surfacePatches { kernelPatches = surfacePatches {
version = pkgVersion; version = srcVersion;
patchFn = ./kernel/${versions.majorMinor pkgVersion}/patches.nix; patchFn = ./kernel/${versions.majorMinor srcVersion}/patches.nix;
patchSrc = (repos.linux-surface + "/patches/${versions.majorMinor pkgVersion}"); patchSrc = (repos.linux-surface + "/patches/${versions.majorMinor srcVersion}");
}; };
kernelPackages = linuxPackage { kernelPackages = linuxPackage {
inherit kernelPatches; inherit kernelPatches;