zfs: use meta.broken instead of throw when incompatible with kernel
`throw` aborts eval when the package is touched in inappropriate places. See https://github.com/NixOS/nixpkgs/issues/109001 for an adverse instance of that. ZFS now behaves like a regular broken package when it's, you know, broken. It also still prints the helpful incompatibility notice when fully evaluated.
This commit is contained in:
parent
b97a90532e
commit
aa58df5312
@ -27,14 +27,8 @@ let
|
|||||||
, rev ? "zfs-${version}"
|
, rev ? "zfs-${version}"
|
||||||
, isUnstable ? false
|
, isUnstable ? false
|
||||||
, incompatibleKernelVersion ? null }:
|
, incompatibleKernelVersion ? null }:
|
||||||
if buildKernel &&
|
|
||||||
(incompatibleKernelVersion != null) &&
|
stdenv.mkDerivation {
|
||||||
versionAtLeast kernel.version incompatibleKernelVersion then
|
|
||||||
throw ''
|
|
||||||
Linux v${kernel.version} is not yet supported by zfsonlinux v${version}.
|
|
||||||
${lib.optionalString (!isUnstable) "Try zfsUnstable or set the NixOS option boot.zfs.enableUnstable."}
|
|
||||||
''
|
|
||||||
else stdenv.mkDerivation {
|
|
||||||
name = "zfs-${configFile}-${version}${optionalString buildKernel "-${kernel.version}"}";
|
name = "zfs-${configFile}-${version}${optionalString buildKernel "-${kernel.version}"}";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
@ -174,6 +168,13 @@ let
|
|||||||
license = licenses.cddl;
|
license = licenses.cddl;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
maintainers = with maintainers; [ hmenke jcumming jonringer wizeman fpletz globin mic92 ];
|
maintainers = with maintainers; [ hmenke jcumming jonringer wizeman fpletz globin mic92 ];
|
||||||
|
broken = if
|
||||||
|
buildKernel && (incompatibleKernelVersion != null) && versionAtLeast kernel.version incompatibleKernelVersion
|
||||||
|
then builtins.trace ''
|
||||||
|
Linux v${kernel.version} is not yet supported by zfsonlinux v${version}.
|
||||||
|
${lib.optionalString (!isUnstable) "Try zfsUnstable or set the NixOS option boot.zfs.enableUnstable."}
|
||||||
|
'' true
|
||||||
|
else false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user