Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions pkgs/os-specific/linux/zfs/2_2.nix
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
callPackage,
kernel ? null,
stdenv,
lib,
nixosTests,
stdenv,
...
}@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.
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;
};
tests =
{
inherit (nixosTests.zfs) series_2_2;
}
// lib.optionalAttrs stdenv.isx86_64 {
inherit (nixosTests.zfs) installer;
};

maintainers = with lib.maintainers; [
adamcstephens
amarshall
];

hash = "sha256-nFOB0/7YK4e8ODoW9A+RQDkZHG/isp2EBOE48zTaMP4=";
hash = "sha256-ZYgC8L4iI9ewaC7rkMFSRAKeTWr72N5aRP98VLL4oqo=";
}
16 changes: 8 additions & 8 deletions pkgs/os-specific/linux/zfs/2_3.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
{
callPackage,
kernel ? null,
stdenv,
lib,
nixosTests,
stdenv,
...
}@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.
Expand All @@ -20,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
Expand Down
42 changes: 26 additions & 16 deletions pkgs/os-specific/linux/zfs/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ let
pkg-config,
curl,
pam,
nix-update-script,

# Kernel dependencies
kernel ? null,
Expand Down Expand Up @@ -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]+)"
Copy link
Member

@amarshall amarshall Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ZFS often has a x.y.99 tag that is mutable and not an actual release—can we skip that somehow? Something not-great-but-probably-fine like [0-8]?[0-9] perhaps? But I think that nix-update actually only uses GitHub releases, not tags, so it doesn’t matter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it can/does use tags as well. Looking through the previous tags, I'm not sure if this will be a problem in practice. Upstream seems to tag x.x.99 during the RC cycle, for whatever reason, and since this logic is pinned to only stable releases and matching versions, I don't suspect problems. I suggest we merge as-is, and if the bot messes up a PR we can address then. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also as a singular data point, I used this updater to do the update, and it did not pick up the older 2.2.99. I think nix-update only fetches a page or two of releases/tags, and favors newest by time anyway.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea I think it should be fine, bringing it up to at least discuss it and validate 🙂

"--override-filename=pkgs/os-specific/linux/zfs/${lib.versions.major version}_${lib.versions.minor version}.nix"
];
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

};

meta = {
description = "ZFS Filesystem Linux" + (if buildUser then " Userspace Tools" else " Kernel Module");
Expand Down
5 changes: 0 additions & 5 deletions pkgs/os-specific/linux/zfs/unstable.nix
Original file line number Diff line number Diff line change
@@ -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.
Expand Down