diff --git a/nixos/modules/security/pam.nix b/nixos/modules/security/pam.nix index ed03254cb5ee5..cd10a9b500ee5 100644 --- a/nixos/modules/security/pam.nix +++ b/nixos/modules/security/pam.nix @@ -1458,9 +1458,9 @@ in ''; } { - assertion = config.security.pam.zfs.enable -> (config.boot.zfs.enabled || config.boot.zfs.enableUnstable); + assertion = config.security.pam.zfs.enable -> config.boot.zfs.enabled; message = '' - `security.pam.zfs.enable` requires enabling ZFS (`boot.zfs.enabled` or `boot.zfs.enableUnstable`). + `security.pam.zfs.enable` requires enabling ZFS (`boot.zfs.enabled`). ''; } { diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix index c6a153cfcb2d7..7bb2d973647d0 100644 --- a/nixos/modules/tasks/filesystems/zfs.nix +++ b/nixos/modules/tasks/filesystems/zfs.nix @@ -211,6 +211,7 @@ in imports = [ (mkRemovedOptionModule [ "boot" "zfs" "enableLegacyCrypto" ] "The corresponding package was removed from nixpkgs.") + (mkRemovedOptionModule [ "boot" "zfs" "enableUnstable" ] "Instead set `boot.zfs.package = pkgs.zfs_unstable;`") ]; ###### interface @@ -219,9 +220,9 @@ in boot.zfs = { package = mkOption { type = types.package; - default = if cfgZfs.enableUnstable then pkgs.zfsUnstable else pkgs.zfs; - defaultText = literalExpression "if zfsUnstable is enabled then pkgs.zfsUnstable else pkgs.zfs"; - description = lib.mdDoc "Configured ZFS userland tools package, use `pkgs.zfsUnstable` if you want to track the latest staging ZFS branch."; + default = pkgs.zfs; + defaultText = literalExpression "pkgs.zfs"; + description = lib.mdDoc "Configured ZFS userland tools package, use `pkgs.zfs_unstable` if you want to track the latest staging ZFS branch."; }; modulePackage = mkOption { @@ -239,19 +240,6 @@ in description = lib.mdDoc "True if ZFS filesystem support is enabled"; }; - enableUnstable = mkOption { - type = types.bool; - default = false; - description = lib.mdDoc '' - Use the unstable zfs package. This might be an option, if the latest - kernel is not yet supported by a published release of ZFS. Enabling - this option will install a development version of ZFS on Linux. The - version will have already passed an extensive test suite, but it is - more likely to hit an undiscovered bug compared to running a released - version of ZFS on Linux. - ''; - }; - allowHibernation = mkOption { type = types.bool; default = false; diff --git a/nixos/tests/zfs.nix b/nixos/tests/zfs.nix index 0b411b0b9d8a5..851fced2c5e1e 100644 --- a/nixos/tests/zfs.nix +++ b/nixos/tests/zfs.nix @@ -7,14 +7,14 @@ with import ../lib/testing-python.nix { inherit system pkgs; }; let - makeZfsTest = name: + makeZfsTest = { kernelPackages , enableSystemdStage1 ? false , zfsPackage , extraTest ? "" }: makeTest { - name = "zfs-" + name; + name = zfsPackage.kernelModuleAttribute; meta = with pkgs.lib.maintainers; { maintainers = [ elvishjerricco ]; }; @@ -192,23 +192,23 @@ let in { # maintainer: @raitobezarius - series_2_1 = makeZfsTest "2.1-series" { + series_2_1 = makeZfsTest { zfsPackage = pkgs.zfs_2_1; kernelPackages = pkgs.linuxPackages; }; - stable = makeZfsTest "stable" { - zfsPackage = pkgs.zfsStable; + series_2_2 = makeZfsTest { + zfsPackage = pkgs.zfs_2_2; kernelPackages = pkgs.linuxPackages; }; - unstable = makeZfsTest "unstable" rec { - zfsPackage = pkgs.zfsUnstable; + unstable = makeZfsTest rec { + zfsPackage = pkgs.zfs_unstable; kernelPackages = zfsPackage.latestCompatibleLinuxPackages; }; - unstableWithSystemdStage1 = makeZfsTest "unstable" rec { - zfsPackage = pkgs.zfsUnstable; + unstableWithSystemdStage1 = makeZfsTest rec { + zfsPackage = pkgs.zfs_unstable; kernelPackages = zfsPackage.latestCompatibleLinuxPackages; enableSystemdStage1 = true; }; diff --git a/pkgs/os-specific/linux/zfs/stable.nix b/pkgs/os-specific/linux/zfs/2_2.nix similarity index 90% rename from pkgs/os-specific/linux/zfs/stable.nix rename to pkgs/os-specific/linux/zfs/2_2.nix index 7ca1d5be3787d..3e5d262f73d06 100644 --- a/pkgs/os-specific/linux/zfs/stable.nix +++ b/pkgs/os-specific/linux/zfs/2_2.nix @@ -12,7 +12,7 @@ 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"; + kernelModuleAttribute = "zfs_2_2"; # check the release notes for compatible kernels kernelCompatible = kernel.kernelOlder "6.8"; @@ -23,7 +23,7 @@ callPackage ./generic.nix args { tests = [ nixosTests.zfs.installer - nixosTests.zfs.stable + nixosTests.zfs.series_2_2 ]; hash = "sha256-Bzkow15OitUUQ+mTYhCXgTrQl+ao/B4feleHY/rSSjg="; diff --git a/pkgs/os-specific/linux/zfs/generic.nix b/pkgs/os-specific/linux/zfs/generic.nix index 566af6950d483..c0ff834cb34ab 100644 --- a/pkgs/os-specific/linux/zfs/generic.nix +++ b/pkgs/os-specific/linux/zfs/generic.nix @@ -234,8 +234,8 @@ let inherit maintainers; mainProgram = "zfs"; - # If your Linux kernel version is not yet supported by zfs, try zfsUnstable. - # On NixOS set the option boot.zfs.enableUnstable. + # If your Linux kernel version is not yet supported by zfs, try zfs_unstable. + # On NixOS set the option `boot.zfs.package = pkgs.zfs_unstable`. broken = buildKernel && (kernelCompatible != null) && !kernelCompatible; }; }; diff --git a/pkgs/os-specific/linux/zfs/unstable.nix b/pkgs/os-specific/linux/zfs/unstable.nix index 2bd06e0d6b749..052dd0cd74c9a 100644 --- a/pkgs/os-specific/linux/zfs/unstable.nix +++ b/pkgs/os-specific/linux/zfs/unstable.nix @@ -12,7 +12,7 @@ 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 = "zfsUnstable"; + kernelModuleAttribute = "zfs_unstable"; # check the release notes for compatible kernels kernelCompatible = kernel.kernelOlder "6.9"; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 5d0ef64bf9a60..fab717bc0d1d4 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1211,6 +1211,8 @@ mapAliases ({ ### Z ### zabbix40 = throw "'zabbix40' has been removed as it has reached end of life"; # Added 2024-01-07 + zfsStable = zfs; # Added 2024-02-26 + zfsUnstable = zfs_unstable; # Added 2024-02-26 zinc = zincsearch; # Added 2023-05-28 zkg = throw "'zkg' has been replaced by 'zeek'"; zq = zed.overrideAttrs (old: { meta = old.meta // { mainProgram = "zq"; }; }); # Added 2023-02-06 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e8a5bb73d67ba..16ed76753c96f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28726,16 +28726,22 @@ with pkgs; zenmonitor = callPackage ../os-specific/linux/zenmonitor { }; - zfs_2_1 = callPackage ../os-specific/linux/zfs/2_1.nix { - configFile = "user"; - }; - zfsStable = callPackage ../os-specific/linux/zfs/stable.nix { - configFile = "user"; - }; - zfsUnstable = callPackage ../os-specific/linux/zfs/unstable.nix { - configFile = "user"; - }; - zfs = zfsStable; + inherit + ({ + zfs_2_1 = callPackage ../os-specific/linux/zfs/2_1.nix { + configFile = "user"; + }; + zfs_2_2 = callPackage ../os-specific/linux/zfs/2_2.nix { + configFile = "user"; + }; + zfs_unstable = callPackage ../os-specific/linux/zfs/unstable.nix { + configFile = "user"; + }; + }) + zfs_2_1 + zfs_2_2 + zfs_unstable; + zfs = zfs_2_2; ### DATA diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index 47838b60569fb..f54280683b9c5 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -565,15 +565,15 @@ in { configFile = "kernel"; inherit pkgs kernel; }; - zfsStable = callPackage ../os-specific/linux/zfs/stable.nix { + zfs_2_2 = callPackage ../os-specific/linux/zfs/2_2.nix { configFile = "kernel"; inherit pkgs kernel; }; - zfsUnstable = callPackage ../os-specific/linux/zfs/unstable.nix { + zfs_unstable = callPackage ../os-specific/linux/zfs/unstable.nix { configFile = "kernel"; inherit pkgs kernel; }; - zfs = zfsStable; + zfs = zfs_2_2; can-isotp = callPackage ../os-specific/linux/can-isotp { };