diff --git a/hosts/server/configuration.nix b/hosts/server/configuration.nix index eeb9cbc..97b84b6 100644 --- a/hosts/server/configuration.nix +++ b/hosts/server/configuration.nix @@ -6,7 +6,7 @@ { # Note this might jump back and forth as kernels are added or removed. # boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; -boot.kernelModules = [ "zfs" ]; +#boot.kernelModules = [ "zfs" ]; imports = [ # Include the results of the hardware scan. ../../common/configuration.nix @@ -14,6 +14,19 @@ boot.kernelModules = [ "zfs" ]; ../../modules/nix/remote-builder-client.nix ]; +boot.kernelPackages = lib.last ( + lib.sort (a: b: (lib.versionOlder a.kernel.version b.kernel.version)) ( + builtins.attrValues ( + 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 + ) + ) + ); + networking.hostName = "server"; # Define your hostname. networking.hostId = "6689f93e"; # Pick only one of the below networking options.