From 226f8c7618c5d3f7f00cb21af3ad29a50ee1ec29 Mon Sep 17 00:00:00 2001 From: Will Fancher Date: Sun, 21 Jun 2026 11:29:12 -0400 Subject: [PATCH] buildLinux: Forward buildDTBs and target arguments Fixes #533937 --- pkgs/os-specific/linux/kernel/build.nix | 2 - pkgs/os-specific/linux/kernel/generic.nix | 49 ++++++++++++++--------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/build.nix b/pkgs/os-specific/linux/kernel/build.nix index 8d727aa521fb..ad2523797aa8 100644 --- a/pkgs/os-specific/linux/kernel/build.nix +++ b/pkgs/os-specific/linux/kernel/build.nix @@ -152,8 +152,6 @@ lib.makeOverridable ( isModular = config.isYes "MODULES"; withRust = config.isYes "RUST"; - inherit buildDTBs target; - # Dependencies that are required to build kernel modules moduleBuildDependencies = [ pahole diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index 30c356823ddc..284f3f1e1820 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -79,6 +79,9 @@ lib.makeOverridable ( extraMeta ? { }, extraPassthru ? { }, + target ? null, + buildDTBs ? null, + isLTS ? false, isZen ? false, @@ -284,26 +287,34 @@ lib.makeOverridable ( }; }; # end of configfile derivation - kernel = (callPackage ./build.nix { inherit lib stdenv buildPackages; }) { - inherit - pname - version - src - kernelPatches - randstructSeed - extraMakeFlags - extraMeta - configfile - modDirVersion - ; - pos = builtins.unsafeGetAttrPos "version" args; + kernel = (callPackage ./build.nix { inherit lib stdenv buildPackages; }) ( + { + inherit + pname + version + src + kernelPatches + randstructSeed + extraMakeFlags + extraMeta + configfile + modDirVersion + ; + pos = builtins.unsafeGetAttrPos "version" args; - config = { - CONFIG_MODULES = "y"; - CONFIG_FW_LOADER = "y"; - CONFIG_RUST = if withRust then "y" else "n"; - }; - }; + config = { + CONFIG_MODULES = "y"; + CONFIG_FW_LOADER = "y"; + CONFIG_RUST = if withRust then "y" else "n"; + }; + } + // lib.optionalAttrs (target != null) { + inherit target; + } + // lib.optionalAttrs (buildDTBs != null) { + inherit buildDTBs; + } + ); in kernel.overrideAttrs (