From 1041fb01e5bab42cac9e8e42367cd67ae4d47b66 Mon Sep 17 00:00:00 2001 From: K900 Date: Thu, 11 Jun 2026 15:38:11 +0300 Subject: [PATCH] bootspec: honor boot.kernel.enable WSL and other container-brained-but-not-really systems may not want a kernel, and now that bootspec is no longer optional, this pulls one in anyway. (cherry picked from commit 1fdf8fd586508bc91d6d815fc8900695348f2902) --- nixos/modules/system/activation/bootspec.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/modules/system/activation/bootspec.nix b/nixos/modules/system/activation/bootspec.nix index c625b91ec1e2..e1253d2fea64 100644 --- a/nixos/modules/system/activation/bootspec.nix +++ b/nixos/modules/system/activation/bootspec.nix @@ -26,9 +26,11 @@ let // { "org.nixos.bootspec.v1" = { system = config.boot.kernelPackages.stdenv.hostPlatform.system; + label = "${config.system.nixos.distroName} ${config.system.nixos.codeName} ${config.system.nixos.label} (Linux ${config.boot.kernelPackages.kernel.modDirVersion})"; + } + // lib.optionalAttrs config.boot.kernel.enable { kernel = "${config.boot.kernelPackages.kernel}/${config.system.boot.loader.kernelFile}"; kernelParams = config.boot.kernelParams; - label = "${config.system.nixos.distroName} ${config.system.nixos.codeName} ${config.system.nixos.label} (Linux ${config.boot.kernelPackages.kernel.modDirVersion})"; } // lib.optionalAttrs config.boot.initrd.enable { initrd = "${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}";