mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 04:39:23 +08:00
modules.system.kernel: fix kernel build failed
This commit is contained in:
@@ -68,15 +68,19 @@ inputs:
|
||||
{
|
||||
hibernate-progress = [{ name = "hibernate-progress"; patch = ./hibernate-progress.patch; }];
|
||||
btrfs =
|
||||
[{
|
||||
name = "btrfs";
|
||||
patch = inputs.pkgs.fetchurl
|
||||
{
|
||||
url = "https://github.com/kakra/linux/pull/36.patch";
|
||||
sha256 = "0wimihsvrxib6g23jcqdbvqlkqk6nbqjswfx9bzmpm1vlvzxj8m0";
|
||||
};
|
||||
structuredExtraConfig.BTRFS_EXPERIMENTAL = inputs.lib.kernel.yes;
|
||||
}];
|
||||
let configName =
|
||||
if inputs.config.nixos.system.kernel.variant == "xanmod-unstable" then "structuredExtraConfig"
|
||||
else "extraStructuredConfig";
|
||||
in
|
||||
[{
|
||||
name = "btrfs";
|
||||
patch = inputs.pkgs.fetchurl
|
||||
{
|
||||
url = "https://github.com/kakra/linux/pull/36.patch";
|
||||
sha256 = "0wimihsvrxib6g23jcqdbvqlkqk6nbqjswfx9bzmpm1vlvzxj8m0";
|
||||
};
|
||||
${configName}.BTRFS_EXPERIMENTAL = inputs.lib.kernel.yes;
|
||||
}];
|
||||
};
|
||||
in builtins.concatLists (builtins.map (name: patches.${name}) kernel.patches);
|
||||
};
|
||||
|
||||
@@ -21,16 +21,22 @@ inputs:
|
||||
nixpkgs = nixpkgs // { nixRoot = null; nixos = true; inherit (inputs.config.nixos.model) arch; };
|
||||
};
|
||||
boot.kernelPatches = inputs.lib.mkIf (nixpkgs.march != null)
|
||||
[{
|
||||
name = "native kernel";
|
||||
patch = null;
|
||||
structuredExtraConfig =
|
||||
let kernelConfig = { znver2 = "MZEN2"; znver3 = "MZEN3"; znver4 = "MZEN4"; znver5 = "MZEN5"; };
|
||||
in
|
||||
{
|
||||
GENERIC_CPU = inputs.lib.kernel.no;
|
||||
${kernelConfig.${nixpkgs.march} or "M${inputs.lib.toUpper nixpkgs.march}"} = inputs.lib.kernel.yes;
|
||||
};
|
||||
}];
|
||||
(
|
||||
let configName =
|
||||
if inputs.config.nixos.system.kernel.variant == "xanmod-unstable" then "structuredExtraConfig"
|
||||
else "extraStructuredConfig";
|
||||
in
|
||||
[{
|
||||
name = "native kernel";
|
||||
patch = null;
|
||||
${configName} =
|
||||
let kernelConfig = { znver2 = "MZEN2"; znver3 = "MZEN3"; znver4 = "MZEN4"; znver5 = "MZEN5"; };
|
||||
in
|
||||
{
|
||||
GENERIC_CPU = inputs.lib.kernel.no;
|
||||
${kernelConfig.${nixpkgs.march} or "M${inputs.lib.toUpper nixpkgs.march}"} = inputs.lib.kernel.yes;
|
||||
};
|
||||
}]
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user