mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 04:39:23 +08:00
surface: fix kernel
This commit is contained in:
@@ -57,23 +57,20 @@ inputs:
|
||||
};
|
||||
bugs = [ "xmunet" ];
|
||||
};
|
||||
# apply patches from nixos-hardware
|
||||
boot.kernelPatches = builtins.map
|
||||
(patch:
|
||||
{ inherit (patch) name patch; }
|
||||
// (if patch ? structuredExtraConfig then { extraStructuredConfig = patch.structuredExtraConfig; } else {}))
|
||||
(
|
||||
let
|
||||
version = inputs.config.boot.kernelPackages.kernel.version;
|
||||
majorVersion =
|
||||
let versionArray = builtins.splitVersion version;
|
||||
in "${builtins.elemAt versionArray 0}.${builtins.elemAt versionArray 1}";
|
||||
repoFile = "${inputs.topInputs.nixos-hardware}/microsoft/surface/common/kernel/linux-package.nix";
|
||||
inherit (inputs.pkgs.callPackage repoFile {}) repos;
|
||||
patchDir = repos.linux-surface + "/patches/${majorVersion}";
|
||||
patchFile = "${inputs.topInputs.nixos-hardware}/microsoft/surface/common/kernel/linux-6.6.x/patches.nix";
|
||||
in
|
||||
inputs.pkgs.callPackage patchFile { inherit (inputs.lib) kernel; inherit version patchDir; }
|
||||
);
|
||||
boot.kernelPackages =
|
||||
let
|
||||
originalKernel = inputs.pkgs.linuxPackages_xanmod_latest.kernel;
|
||||
version = originalKernel.version;
|
||||
majorVersion =
|
||||
let versionArray = builtins.splitVersion version;
|
||||
in "${builtins.elemAt versionArray 0}.${builtins.elemAt versionArray 1}";
|
||||
repoFile = "${inputs.topInputs.nixos-hardware}/microsoft/surface/common/kernel/linux-package.nix";
|
||||
inherit (inputs.pkgs.callPackage repoFile {}) repos;
|
||||
patchDir = repos.linux-surface + "/patches/${majorVersion}";
|
||||
patchFile = "${inputs.topInputs.nixos-hardware}/microsoft/surface/common/kernel/linux-6.6.x/patches.nix";
|
||||
kernelPatches = inputs.pkgs.callPackage patchFile { inherit (inputs.lib) kernel; inherit version patchDir; };
|
||||
in
|
||||
inputs.lib.mkForce (inputs.pkgs.linuxPackagesFor (originalKernel.override
|
||||
(prev: { kernelPatches = prev.kernelPatches ++ kernelPatches; })));
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user