diff --git a/pkgs/os-specific/linux/kernel/build.nix b/pkgs/os-specific/linux/kernel/build.nix index da50861fb459..4ec0c63cb761 100644 --- a/pkgs/os-specific/linux/kernel/build.nix +++ b/pkgs/os-specific/linux/kernel/build.nix @@ -51,6 +51,8 @@ lib.makeOverridable ( version, # The kernel pname (should be set for variants) pname ? "linux", + # Position of the Linux build expression + pos ? null, # Additional kernel make flags extraMakeFlags ? [ ], # The name of the kernel module directory @@ -551,6 +553,8 @@ lib.makeOverridable ( karch = stdenv.hostPlatform.linuxArch; + pos = lib.optionalDrvAttr (pos != null) pos; + meta = { # https://github.com/NixOS/nixpkgs/pull/345534#issuecomment-2391238381 broken = withRust && lib.versionOlder version "6.12"; diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index 8eecd334df70..456e9052d5c2 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -293,6 +293,7 @@ let configfile modDirVersion ; + pos = builtins.unsafeGetAttrPos "version" args; config = { CONFIG_MODULES = "y";