diff options
Diffstat (limited to 'nixpkgs/pkgs/os-specific/linux/kernel/generic.nix')
-rw-r--r-- | nixpkgs/pkgs/os-specific/linux/kernel/generic.nix | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/generic.nix b/nixpkgs/pkgs/os-specific/linux/kernel/generic.nix index 7f2a97d868ed..bca6554ca2ae 100644 --- a/nixpkgs/pkgs/os-specific/linux/kernel/generic.nix +++ b/nixpkgs/pkgs/os-specific/linux/kernel/generic.nix @@ -60,7 +60,7 @@ , kernelTests ? [] , nixosTests , ... -}: +}@args: # Note: this package is used for bootstrapping fetchurl, and thus # cannot use fetchpatch! All mutable patches (generated by GitHub or @@ -70,6 +70,18 @@ assert stdenv.isLinux; let + # Dirty hack to make sure that `version` & `src` have + # `<nixpkgs/pkgs/os-specific/linux/kernel/linux-x.y.nix>` 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 = builtins.removeAttrs + args + (lib.filter (x: ! (builtins.elem x [ "version" "src" ])) (lib.attrNames args)); + # Combine the `features' attribute sets of all the kernel patches. kernelFeatures = lib.foldr (x: y: (x.features or {}) // y) ({ iwlwifi = true; @@ -180,18 +192,17 @@ let }; }; # end of configfile derivation - kernel = (callPackage ./manual-config.nix { inherit buildPackages; }) { - inherit version modDirVersion src kernelPatches randstructSeed lib stdenv extraMakeFlags extraMeta configfile; + kernel = (callPackage ./manual-config.nix { inherit buildPackages; }) (basicArgs // { + inherit modDirVersion kernelPatches randstructSeed lib stdenv extraMakeFlags extraMeta configfile; + pos = builtins.unsafeGetAttrPos "version" args; config = { CONFIG_MODULES = "y"; CONFIG_FW_LOADER = "m"; }; - }; + }); - passthru = { + passthru = basicArgs // { features = kernelFeatures; inherit commonStructuredConfig structuredExtraConfig extraMakeFlags isZen isHardened isLibre modDirVersion; isXen = lib.warn "The isXen attribute is deprecated. All Nixpkgs kernels that support it now have Xen enabled." true; - kernelOlder = lib.versionOlder version; - kernelAtLeast = lib.versionAtLeast version; passthru = kernel.passthru // (removeAttrs passthru [ "passthru" ]); tests = let overridableKernel = finalKernel // { |