From dccb264578d8a86d01c913895cc8f767702e9385 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 10 Aug 2025 13:10:12 +0200 Subject: [PATCH] linux: remove mentions of extraStructuredConfig & throw error PR #431115 changed extraStructuredConfig to structuredExtraConfig to follow the deprecation warning about `extraConfig`. However, `extraStructuredConfig` was mentioned in several places in the docs that weren't addressed. Also, using this would silently fail since the code in question would still accept the old key. This patch updates the docs accordingly and throws an error if the code-path is reached and `extraStructuredConfig` is being used. --- doc/packages/linux.section.md | 2 +- nixos/modules/system/boot/kernel.nix | 6 +++--- pkgs/os-specific/linux/kernel/generic.nix | 15 +++++++++++---- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/doc/packages/linux.section.md b/doc/packages/linux.section.md index 5c36c593ca74..311613e411b3 100644 --- a/doc/packages/linux.section.md +++ b/doc/packages/linux.section.md @@ -25,7 +25,7 @@ pkgs.linux_latest.override { ignoreConfigErrors = true; autoModules = false; kernelPreferBuiltin = true; - extraStructuredConfig = with lib.kernel; { + structuredExtraConfig = with lib.kernel; { DEBUG_KERNEL = yes; FRAME_POINTER = yes; KGDB = yes; diff --git a/nixos/modules/system/boot/kernel.nix b/nixos/modules/system/boot/kernel.nix index 9cb2148d283b..3a7f0d19db94 100644 --- a/nixos/modules/system/boot/kernel.nix +++ b/nixos/modules/system/boot/kernel.nix @@ -102,7 +102,7 @@ in { name = "foo"; patch = ./foo.patch; - extraStructuredConfig.FOO = lib.kernel.yes; + structuredExtraConfig.FOO = lib.kernel.yes; features.foo = true; } { @@ -127,7 +127,7 @@ in # (required, but can be null if only config changes # are needed) - extraStructuredConfig = { # attrset of extra configuration parameters without the CONFIG_ prefix + structuredExtraConfig = { # attrset of extra configuration parameters without the CONFIG_ prefix FOO = lib.kernel.yes; # (optional) }; # values should generally be lib.kernel.yes, # lib.kernel.no or lib.kernel.module @@ -138,7 +138,7 @@ in extraConfig = "FOO y"; # extra configuration options in string form without the CONFIG_ prefix # (optional, multiple lines allowed to specify multiple options) - # (deprecated, use extraStructuredConfig instead) + # (deprecated, use structuredExtraConfig instead) } ``` diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index de7521eeeaa5..7e86efa4c9bb 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -141,10 +141,17 @@ let { structuredExtraConfig ? { }, ... - }: - { - settings = structuredExtraConfig; - } + }@args: + if args ? extraStructuredConfig then + throw '' + Passing `extraStructuredConfig` to the Linux kernel (e.g. + via `boot.kernelPatches` in NixOS) is not supported anymore. Use + `structuredExtraConfig` instead. + '' + else + { + settings = structuredExtraConfig; + } ) kernelPatches; # appends kernel patches extraConfig