diff --git a/flake.lock b/flake.lock index 05c8579..9aa2c24 100644 --- a/flake.lock +++ b/flake.lock @@ -18,11 +18,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1726658796, - "narHash": "sha256-SiiWCVg/W8i6jvpgQj3NNd3YtV+jfnn/t3Za7hfn1iE=", + "lastModified": 1726798147, + "narHash": "sha256-k/Ojv+MUDKUbj8JPd1MulJrf5BVz3jIUfrreMHbeTBE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "75ac2a58e988a346960938ab16cea903a3cb053a", + "rev": "e88358265511d3a73b30dc6e4c15579844b35280", "type": "github" }, "original": { diff --git a/nix/installer.nix b/nix/installer.nix index 740567a..14b2b42 100644 --- a/nix/installer.nix +++ b/nix/installer.nix @@ -4,6 +4,14 @@ pkgs, ... }: +let + latestZfsCompatibleLinuxPackages = lib.pipe pkgs.linuxKernel.packages [ + builtins.attrValues + (builtins.filter (kPkgs: (builtins.tryEval kPkgs).success && kPkgs ? kernel && kPkgs.kernel.pname == "linux" && !kPkgs.zfs.meta.broken)) + (builtins.sort (a: b: (lib.versionOlder a.kernel.version b.kernel.version))) + lib.last + ]; +in { # more descriptive hostname than just "nixos" networking.hostName = lib.mkDefault "nixos-installer"; @@ -16,7 +24,7 @@ # use latest kernel we can support to get more hardware support boot.zfs.package = pkgs.zfsUnstable; - boot.kernelPackages = pkgs.zfsUnstable.latestCompatibleLinuxPackages; + boot.kernelPackages = latestZfsCompatibleLinuxPackages; documentation.enable = false; documentation.man.man-db.enable = false;