From 845e340ed98ef6d8a5c5d7069663f2cd034e508a Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Mon, 29 Sep 2025 11:45:57 +0200 Subject: [PATCH] linux: drop hacky passing around of positions This is something I introduced in 63185299f4c8beecac7e204dc20394f38e68a477 to make sure the `version`/`src` attributes point to the files that declare the version such that we get pinged by ofborg for updates. This is long obsolete since the versions are maintained in a JSON file now. Also, the kernel team is listed as owner in the ci/OWNERS file for the entire subtree, so we definitely get pinged by CI nowadays. Hence, remove the hackery. --- pkgs/os-specific/linux/kernel/generic.nix | 59 +++++++------------ .../linux/kernel/manual-config.nix | 4 -- 2 files changed, 20 insertions(+), 43 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index cd3fc4a73b21..0121686b086a 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -24,6 +24,8 @@ let overridableKernel = lib.makeOverridable ( # The kernel source tarball. { + pname ? "linux", + src, # The kernel version. @@ -96,25 +98,6 @@ let # files. let - # Dirty hack to make sure that `version` & `src` have - # `` as position - # when using `builtins.unsafeGetAttrPos`. - # - # This is to make sure that ofborg actually detects changes in the kernel derivation - # and pings all maintainers. - # - # For further context, see https://github.com/NixOS/nixpkgs/pull/143113#issuecomment-953319957 - basicArgs = removeAttrs args ( - lib.filter ( - x: - !(builtins.elem x [ - "version" - "pname" - "src" - ]) - ) (lib.attrNames args) - ); - # Combine the `features' attribute sets of all the kernel patches. kernelFeatures = lib.foldr (x: y: (x.features or { }) // y) ( { @@ -298,26 +281,25 @@ let }; }; # end of configfile derivation - kernel = (callPackage ./manual-config.nix { inherit lib stdenv buildPackages; }) ( - basicArgs - // { - inherit - kernelPatches - randstructSeed - extraMakeFlags - extraMeta - configfile - modDirVersion - ; - pos = builtins.unsafeGetAttrPos "version" args; + kernel = (callPackage ./manual-config.nix { inherit lib stdenv buildPackages; }) { + inherit + pname + version + src + kernelPatches + randstructSeed + extraMakeFlags + extraMeta + configfile + modDirVersion + ; - 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"; + }; + }; in kernel.overrideAttrs ( @@ -326,7 +308,6 @@ let passthru = previousAttrs.passthru or { } // extraPassthru - // basicArgs // { features = kernelFeatures; inherit diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 807fd00e504f..0839eaa9fdd9 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -51,8 +51,6 @@ 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,8 +549,6 @@ 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";