Skip to content

Commit da17006

Browse files
authored
Merge pull request #1681 from 8bitbuddhist/surface-kernel-simplify
microsoft/surface: simplify patch pulling
2 parents 63564a6 + ae4fcae commit da17006

File tree

2 files changed

+12
-48
lines changed

2 files changed

+12
-48
lines changed

microsoft/surface/common/default.nix

Lines changed: 12 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -32,57 +32,23 @@ let
3232
else
3333
abort "Invalid kernel version: ${kernelVersion}";
3434

35-
# Set the version and hash for the linux-surface releases
36-
pkgVersion =
37-
with config.hardware.microsoft-surface;
38-
if kernelVersion == "longterm" then
39-
"6.12.7"
40-
else if kernelVersion == "stable" then
41-
"6.15.3"
42-
else
43-
abort "Invalid kernel version: ${kernelVersion}";
44-
45-
pkgHash =
46-
with config.hardware.microsoft-surface;
47-
if kernelVersion == "longterm" then
48-
"sha256-Pv7O8D8ma+MPLhYP3HSGQki+Yczp8b7d63qMb6l4+mY="
49-
else if kernelVersion == "stable" then
50-
"sha256-ozvYrZDiVtMkdCcVnNEdlF2Kdw4jivW0aMJrDynN3Hk="
51-
else
52-
abort "Invalid kernel version: ${kernelVersion}";
53-
54-
# Fetch the linux-surface package
55-
repos =
56-
pkgs.callPackage
57-
(
58-
{
59-
fetchFromGitHub,
60-
rev,
61-
hash,
62-
}:
63-
{
64-
linux-surface = fetchFromGitHub {
65-
owner = "linux-surface";
66-
repo = "linux-surface";
67-
rev = rev;
68-
hash = hash;
69-
};
70-
}
71-
)
72-
{
73-
hash = pkgHash;
74-
rev = "arch-${pkgVersion}-1";
75-
};
35+
# Fetch the latest linux-surface patches
36+
linux-surface = pkgs.fetchFromGitHub {
37+
owner = "linux-surface";
38+
repo = "linux-surface";
39+
rev = "50d0ed6be462a5fdb643cfe8469bf69158afae42";
40+
hash = "sha256-ozvYrZDiVtMkdCcVnNEdlF2Kdw4jivW0aMJrDynN3Hk=";
41+
};
7642

77-
# Fetch and build the kernel package
78-
inherit (pkgs.callPackage ./kernel/linux-package.nix { inherit repos; })
43+
# Fetch and build the kernel
44+
inherit (pkgs.callPackage ./kernel/linux-package.nix { })
7945
linuxPackage
8046
surfacePatches
8147
;
8248
kernelPatches = surfacePatches {
83-
version = pkgVersion;
84-
patchFn = ./kernel/${versions.majorMinor pkgVersion}/patches.nix;
85-
patchSrc = (repos.linux-surface + "/patches/${versions.majorMinor pkgVersion}");
49+
version = srcVersion;
50+
patchFn = ./kernel/${versions.majorMinor srcVersion}/patches.nix;
51+
patchSrc = (linux-surface + "/patches/${versions.majorMinor srcVersion}");
8652
};
8753
kernelPackages = linuxPackage {
8854
inherit kernelPatches;

microsoft/surface/common/kernel/linux-package.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
fetchurl,
55
buildLinux,
66
linuxPackagesFor,
7-
repos,
87
}:
98

109
let
@@ -74,7 +73,6 @@ in
7473
{
7574
inherit
7675
linuxPackage
77-
repos
7876
surfacePatches
7977
versionsOf
8078
isVersionOf

0 commit comments

Comments
 (0)