Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 12 additions & 46 deletions microsoft/surface/common/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,57 +32,23 @@ let
else
abort "Invalid kernel version: ${kernelVersion}";

# Set the version and hash for the linux-surface releases
pkgVersion =
with config.hardware.microsoft-surface;
if kernelVersion == "longterm" then
"6.12.7"
else if kernelVersion == "stable" then
"6.15.3"
else
abort "Invalid kernel version: ${kernelVersion}";

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 the latest linux-surface patches
linux-surface = pkgs.fetchFromGitHub {
owner = "linux-surface";
repo = "linux-surface";
rev = "50d0ed6be462a5fdb643cfe8469bf69158afae42";
hash = "sha256-ozvYrZDiVtMkdCcVnNEdlF2Kdw4jivW0aMJrDynN3Hk=";
};

# Fetch and build the kernel package
inherit (pkgs.callPackage ./kernel/linux-package.nix { inherit repos; })
# Fetch and build the kernel
inherit (pkgs.callPackage ./kernel/linux-package.nix { })
linuxPackage
surfacePatches
;
kernelPatches = surfacePatches {
version = pkgVersion;
patchFn = ./kernel/${versions.majorMinor pkgVersion}/patches.nix;
patchSrc = (repos.linux-surface + "/patches/${versions.majorMinor pkgVersion}");
version = srcVersion;
patchFn = ./kernel/${versions.majorMinor srcVersion}/patches.nix;
patchSrc = (linux-surface + "/patches/${versions.majorMinor srcVersion}");
};
kernelPackages = linuxPackage {
inherit kernelPatches;
Expand Down
2 changes: 0 additions & 2 deletions microsoft/surface/common/kernel/linux-package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
fetchurl,
buildLinux,
linuxPackagesFor,
repos,
}:

let
Expand Down Expand Up @@ -74,7 +73,6 @@ in
{
inherit
linuxPackage
repos
surfacePatches
versionsOf
isVersionOf
Expand Down