From ac74ab0236bb83bbea64538a70ae3f61c0e85235 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Fri, 11 Mar 2022 10:36:10 +1200 Subject: [PATCH] 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. --- pkgs/os-specific/linux/zfs/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix index 7341240f95af..16aed8e4a76a 100644 --- a/pkgs/os-specific/linux/zfs/default.nix +++ b/pkgs/os-specific/linux/zfs/default.nix @@ -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.