From 36a5287b7be467c9ce3143dc56b0c45a6b0b886c Mon Sep 17 00:00:00 2001 From: beatzaplenty Date: Tue, 30 Jun 2026 21:01:31 +0000 Subject: [PATCH] Update hosts/server/configuration.nix --- hosts/server/configuration.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hosts/server/configuration.nix b/hosts/server/configuration.nix index 91d3761..6311ea1 100644 --- a/hosts/server/configuration.nix +++ b/hosts/server/configuration.nix @@ -3,8 +3,22 @@ # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). { config, lib, pkgs, inputs,... }: - +let + zfsCompatibleKernelPackages = lib.filterAttrs ( + name: kernelPackages: + (builtins.match "linux_[0-9]+_[0-9]+" name) != null + && (builtins.tryEval kernelPackages).success + && (!kernelPackages.${config.boot.zfs.package.kernelModuleAttribute}.meta.broken) + ) pkgs.linuxKernel.packages; + latestKernelPackage = lib.last ( + lib.sort (a: b: (lib.versionOlder a.kernel.version b.kernel.version)) ( + builtins.attrValues zfsCompatibleKernelPackages + ) + ); +in { + # Note this might jump back and forth as kernels are added or removed. + boot.kernelPackages = latestKernelPackage; imports = [ # Include the results of the hardware scan. ../../common/configuration.nix