mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2025-11-08 19:46:10 +01:00
microsoft/surface: add kernel source hash logic
This commit is contained in:
parent
8141742b12
commit
9726adf371
1 changed files with 21 additions and 12 deletions
|
|
@ -3,32 +3,41 @@
|
||||||
let
|
let
|
||||||
inherit (lib) mkDefault mkOption types;
|
inherit (lib) mkDefault mkOption types;
|
||||||
|
|
||||||
version = config.microsoft-surface.kernelVersion;
|
shortVersion = config.microsoft-surface.kernelVersion;
|
||||||
rev =
|
version = if shortVersion == "6.12" then
|
||||||
if version == "6.12" then
|
"6.12.19"
|
||||||
"arch-6.12.19-1"
|
else if shortVersion == "6.13" then
|
||||||
else if version == "6.13" then
|
"6.13.6"
|
||||||
"arch-6.13.6-1"
|
|
||||||
else
|
else
|
||||||
abort "Invalid kernel version: ${version}";
|
abort "Invalid kernel version: ${shortVersion}";
|
||||||
|
|
||||||
|
rev = "arch-${version}-1";
|
||||||
|
|
||||||
hash =
|
hash =
|
||||||
if version == "6.12" then
|
if shortVersion == "6.12" then
|
||||||
"sha256-Pv7O8D8ma+MPLhYP3HSGQki+Yczp8b7d63qMb6l4+mY="
|
"sha256-Pv7O8D8ma+MPLhYP3HSGQki+Yczp8b7d63qMb6l4+mY="
|
||||||
else if version == "6.13" then
|
else if shortVersion == "6.13" then
|
||||||
"sha256-otD1ckNxNnvV8xipf9SZpbfg+bBq5EPwyieYtLIV4Ck="
|
"sha256-otD1ckNxNnvV8xipf9SZpbfg+bBq5EPwyieYtLIV4Ck="
|
||||||
else
|
else
|
||||||
abort "Invalid kernel version: ${version}";
|
abort "Invalid kernel version: ${shortVersion}";
|
||||||
|
|
||||||
|
srcHash =
|
||||||
|
if shortVersion == "6.12" then
|
||||||
|
"sha256-1zvwV77ARDSxadG2FkGTb30Ml865I6KB8y413U3MZTE="
|
||||||
|
else if shortVersion == "6.13" then
|
||||||
|
"sha256-3gBTy0E9QI8g/R1XiCGZUbikQD5drBsdkDIJCTis0Zk="
|
||||||
|
else
|
||||||
|
abort "Invalid kernel version: ${shortVersion}";
|
||||||
|
|
||||||
inherit (pkgs.callPackage ./kernel/linux-package.nix { repos = pkgs.callPackage ./kernel/repos.nix { rev = rev; hash = hash; }; }) linuxPackage surfacePatches;
|
inherit (pkgs.callPackage ./kernel/linux-package.nix { repos = pkgs.callPackage ./kernel/repos.nix { rev = rev; hash = hash; }; }) linuxPackage surfacePatches;
|
||||||
|
|
||||||
kernelPatches = surfacePatches {
|
kernelPatches = surfacePatches {
|
||||||
inherit version;
|
inherit version;
|
||||||
patchFn = ./kernel/${version}/patches.nix;
|
patchFn = ./kernel/${shortVersion}/patches.nix;
|
||||||
};
|
};
|
||||||
kernelPackages = linuxPackage {
|
kernelPackages = linuxPackage {
|
||||||
inherit version kernelPatches;
|
inherit version kernelPatches;
|
||||||
sha256 = "sha256-1zvwV77ARDSxadG2FkGTb30Ml865I6KB8y413U3MZTE=";
|
sha256 = srcHash;
|
||||||
ignoreConfigErrors=true;
|
ignoreConfigErrors=true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue