From 725e4612a5832ced353b4912db5863c47e3f0362 Mon Sep 17 00:00:00 2001 From: "Adam C. Stephens" Date: Thu, 12 Jun 2025 15:47:05 -0400 Subject: [PATCH 1/4] zfs: add updateScript for stable releases (cherry picked from commit 745f2c79c539179becc70897ce9c24758b6a939e) --- pkgs/os-specific/linux/zfs/generic.nix | 42 ++++++++++++++++---------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/pkgs/os-specific/linux/zfs/generic.nix b/pkgs/os-specific/linux/zfs/generic.nix index 3360b2cc73196..570b41eacd51f 100644 --- a/pkgs/os-specific/linux/zfs/generic.nix +++ b/pkgs/os-specific/linux/zfs/generic.nix @@ -30,6 +30,7 @@ let pkg-config, curl, pam, + nix-update-script, # Kernel dependencies kernel ? null, @@ -263,22 +264,31 @@ let outputs = [ "out" ] ++ optionals buildUser [ "dev" ]; - passthru = { - inherit kernel; - inherit enableMail kernelModuleAttribute; - latestCompatibleLinuxPackages = lib.warn "zfs.latestCompatibleLinuxPackages is deprecated and is now pointing at the default kernel. If using the stable LTS kernel (default `linuxPackages` is not possible then you must explicitly pin a specific kernel release. For example, `boot.kernelPackages = pkgs.linuxPackages_6_6`. Please be aware that non-LTS kernels are likely to go EOL before ZFS supports the latest supported non-LTS release, requiring manual intervention." linuxPackages; - - # The corresponding userspace tools to this instantiation - # of the ZFS package set. - userspaceTools = genericBuild ( - outerArgs - // { - configFile = "user"; - } - ) innerArgs; - - inherit tests; - }; + passthru = + { + inherit kernel; + inherit enableMail kernelModuleAttribute; + latestCompatibleLinuxPackages = lib.warn "zfs.latestCompatibleLinuxPackages is deprecated and is now pointing at the default kernel. If using the stable LTS kernel (default `linuxPackages` is not possible then you must explicitly pin a specific kernel release. For example, `boot.kernelPackages = pkgs.linuxPackages_6_6`. Please be aware that non-LTS kernels are likely to go EOL before ZFS supports the latest supported non-LTS release, requiring manual intervention." linuxPackages; + + # The corresponding userspace tools to this instantiation + # of the ZFS package set. + userspaceTools = genericBuild ( + outerArgs + // { + configFile = "user"; + } + ) innerArgs; + + inherit tests; + } + // lib.optionalAttrs (kernelModuleAttribute != "zfs_unstable") { + updateScript = nix-update-script { + extraArgs = [ + "--version-regex=^zfs-(${lib.versions.major version}\\.${lib.versions.minor version}\\.[0-9]+)" + "--override-filename=pkgs/os-specific/linux/zfs/${lib.versions.major version}_${lib.versions.minor version}.nix" + ]; + }; + }; meta = { description = "ZFS Filesystem Linux" + (if buildUser then " Userspace Tools" else " Kernel Module"); From 337525f2e6e757033ea5b822812e6cc0379dabb0 Mon Sep 17 00:00:00 2001 From: "Adam C. Stephens" Date: Thu, 12 Jun 2025 15:47:05 -0400 Subject: [PATCH 2/4] zfs: cleanup unused stdenv' (cherry picked from commit 5ac3c6a9868770592517bf7f902c274c482bdffb) --- pkgs/os-specific/linux/zfs/2_2.nix | 5 ----- pkgs/os-specific/linux/zfs/2_3.nix | 5 ----- pkgs/os-specific/linux/zfs/unstable.nix | 5 ----- 3 files changed, 15 deletions(-) diff --git a/pkgs/os-specific/linux/zfs/2_2.nix b/pkgs/os-specific/linux/zfs/2_2.nix index 587c7bc8d96a7..d252704062189 100644 --- a/pkgs/os-specific/linux/zfs/2_2.nix +++ b/pkgs/os-specific/linux/zfs/2_2.nix @@ -1,15 +1,10 @@ { callPackage, - kernel ? null, - stdenv, lib, nixosTests, ... }@args: -let - stdenv' = if kernel == null then stdenv else kernel.stdenv; -in callPackage ./generic.nix args { # You have to ensure that in `pkgs/top-level/linux-kernels.nix` # this attribute is the correct one for this package. diff --git a/pkgs/os-specific/linux/zfs/2_3.nix b/pkgs/os-specific/linux/zfs/2_3.nix index 992cba2a68b02..888b8fca79a07 100644 --- a/pkgs/os-specific/linux/zfs/2_3.nix +++ b/pkgs/os-specific/linux/zfs/2_3.nix @@ -1,15 +1,10 @@ { callPackage, - kernel ? null, - stdenv, lib, nixosTests, ... }@args: -let - stdenv' = if kernel == null then stdenv else kernel.stdenv; -in callPackage ./generic.nix args { # You have to ensure that in `pkgs/top-level/linux-kernels.nix` # this attribute is the correct one for this package. diff --git a/pkgs/os-specific/linux/zfs/unstable.nix b/pkgs/os-specific/linux/zfs/unstable.nix index b2ebfccc14105..be9ad8b682e71 100644 --- a/pkgs/os-specific/linux/zfs/unstable.nix +++ b/pkgs/os-specific/linux/zfs/unstable.nix @@ -1,14 +1,9 @@ { callPackage, - kernel ? null, - stdenv, nixosTests, ... }@args: -let - stdenv' = if kernel == null then stdenv else kernel.stdenv; -in callPackage ./generic.nix args { # You have to ensure that in `pkgs/top-level/linux-kernels.nix` # this attribute is the correct one for this package. From 4d6f98ad204a63c3022ac28920f68fb113aa7a58 Mon Sep 17 00:00:00 2001 From: "Adam C. Stephens" Date: Thu, 12 Jun 2025 15:47:05 -0400 Subject: [PATCH 3/4] zfs_2_2: 2.2.7 -> 2.2.8 https://github.com/openzfs/zfs/releases/tag/zfs-2.2.8 (cherry picked from commit 5a745565dc339818011b98e9026db4ab77d612aa) --- pkgs/os-specific/linux/zfs/2_2.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/zfs/2_2.nix b/pkgs/os-specific/linux/zfs/2_2.nix index d252704062189..c92b39de1746b 100644 --- a/pkgs/os-specific/linux/zfs/2_2.nix +++ b/pkgs/os-specific/linux/zfs/2_2.nix @@ -10,10 +10,10 @@ callPackage ./generic.nix args { # this attribute is the correct one for this package. kernelModuleAttribute = "zfs_2_2"; # check the release notes for compatible kernels - kernelCompatible = kernel: kernel.kernelOlder "6.13"; + kernelCompatible = kernel: kernel.kernelOlder "6.16"; # this package should point to the latest release. - version = "2.2.7"; + version = "2.2.8"; tests = { inherit (nixosTests.zfs) installer series_2_2; @@ -24,5 +24,5 @@ callPackage ./generic.nix args { amarshall ]; - hash = "sha256-nFOB0/7YK4e8ODoW9A+RQDkZHG/isp2EBOE48zTaMP4="; + hash = "sha256-ZYgC8L4iI9ewaC7rkMFSRAKeTWr72N5aRP98VLL4oqo="; } From 2f66fb6dd3b9593d193f90260b9e131842439683 Mon Sep 17 00:00:00 2001 From: "Adam C. Stephens" Date: Thu, 12 Jun 2025 15:57:11 -0400 Subject: [PATCH 4/4] zfs: installer tests are x86 only (cherry picked from commit 06743bb459d23b0c0a20aa531f84a5cad5fbc630) --- pkgs/os-specific/linux/zfs/2_2.nix | 11 ++++++++--- pkgs/os-specific/linux/zfs/2_3.nix | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/pkgs/os-specific/linux/zfs/2_2.nix b/pkgs/os-specific/linux/zfs/2_2.nix index c92b39de1746b..f32312ae3d80e 100644 --- a/pkgs/os-specific/linux/zfs/2_2.nix +++ b/pkgs/os-specific/linux/zfs/2_2.nix @@ -2,6 +2,7 @@ callPackage, lib, nixosTests, + stdenv, ... }@args: @@ -15,9 +16,13 @@ callPackage ./generic.nix args { # this package should point to the latest release. version = "2.2.8"; - tests = { - inherit (nixosTests.zfs) installer series_2_2; - }; + tests = + { + inherit (nixosTests.zfs) series_2_2; + } + // lib.optionalAttrs stdenv.isx86_64 { + inherit (nixosTests.zfs) installer; + }; maintainers = with lib.maintainers; [ adamcstephens diff --git a/pkgs/os-specific/linux/zfs/2_3.nix b/pkgs/os-specific/linux/zfs/2_3.nix index 888b8fca79a07..e88b4c5915941 100644 --- a/pkgs/os-specific/linux/zfs/2_3.nix +++ b/pkgs/os-specific/linux/zfs/2_3.nix @@ -2,6 +2,7 @@ callPackage, lib, nixosTests, + stdenv, ... }@args: @@ -15,9 +16,13 @@ callPackage ./generic.nix args { # this package should point to the latest release. version = "2.3.2"; - tests = { - inherit (nixosTests.zfs) installer series_2_3; - }; + tests = + { + inherit (nixosTests.zfs) series_2_3; + } + // lib.optionalAttrs stdenv.isx86_64 { + inherit (nixosTests.zfs) installer; + }; maintainers = with lib.maintainers; [ adamcstephens