zfs: Remove top-level with from expression

Using `with` in such a high up scope makes it very easy to
accidentally forget to update function arguments and introduce typos
because of the lack of any editor support and static analysis.

It's better to explicitly inherit the small number of things we need
from `lib` into scope so that editors can know of scoped variables.
This commit is contained in:
adisbladis 2022-03-11 10:36:10 +12:00
parent 9097ed78c0
commit ac74ab0236

View file

@ -19,8 +19,9 @@
, linuxPackages_5_15 ? pkgs.linuxKernel.packages.linux_5_15
}:
with lib;
let
inherit (lib) any optionalString optionals optional makeBinPath;
smartmon = smartmontools.override { inherit enableMail; };
buildKernel = any (n: n == configFile) [ "kernel" "all" ];
@ -113,7 +114,7 @@ let
configureFlags = [
"--with-config=${configFile}"
"--with-tirpc=1"
(withFeatureAs (buildUser && enablePython) "python" python3.interpreter)
(lib.withFeatureAs (buildUser && enablePython) "python" python3.interpreter)
] ++ optionals buildUser [
"--with-dracutdir=$(out)/lib/dracut"
"--with-udevdir=$(out)/lib/udev"
@ -200,9 +201,9 @@ let
'';
homepage = "https://github.com/openzfs/zfs";
changelog = "https://github.com/openzfs/zfs/releases/tag/zfs-${version}";
license = licenses.cddl;
platforms = platforms.linux;
maintainers = with maintainers; [ hmenke jcumming jonringer wizeman fpletz globin ];
license = lib.licenses.cddl;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ hmenke jcumming jonringer wizeman fpletz globin ];
mainProgram = "zfs";
# If your Linux kernel version is not yet supported by zfs, try zfsUnstable.
# On NixOS set the option boot.zfs.enableUnstable.