git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commitac74ab0236bb83bbea64538a70ae3f61c0e85235 authoradisbladis <adisbladis@gmail.com> dateFri 11 Mar 2022, 10:36 (5 years ago) parent9097ed7
1 file changed+6−5
pkgs/os-specific/linux/zfs/default.nix+6−5
pkgs/os-specific/linux/zfs/default.nix+6−5
@@ -19,8 +19,9 @@
1919, linuxPackages_5_15 ? pkgs.linuxKernel.packages.linux_5_15
2020}:
2121
22−with lib;
2322let
23+ inherit (lib) any optionalString optionals optional makeBinPath;
24+
2425 smartmon = smartmontools.override { inherit enableMail; };
2526
2627 buildKernel = any (n: n == configFile) [ "kernel" "all" ];
@@ -113,7 +114,7 @@ let
113114 configureFlags = [
114115 "--with-config=${configFile}"
115116 "--with-tirpc=1"
116− (withFeatureAs (buildUser && enablePython) "python" python3.interpreter)
117+ (lib.withFeatureAs (buildUser && enablePython) "python" python3.interpreter)
117118 ] ++ optionals buildUser [
118119 "--with-dracutdir=$(out)/lib/dracut"
119120 "--with-udevdir=$(out)/lib/udev"
@@ -200,9 +201,9 @@ let
200201 '';
201202 homepage = "https://github.com/openzfs/zfs";
202203 changelog = "https://github.com/openzfs/zfs/releases/tag/zfs-${version}";
203− license = licenses.cddl;
204− platforms = platforms.linux;
205− maintainers = with maintainers; [ hmenke jcumming jonringer wizeman fpletz globin ];
204+ license = lib.licenses.cddl;
205+ platforms = lib.platforms.linux;
206+ maintainers = with lib.maintainers; [ hmenke jcumming jonringer wizeman fpletz globin ];
206207 mainProgram = "zfs";
207208 # If your Linux kernel version is not yet supported by zfs, try zfsUnstable.
208209 # On NixOS set the option boot.zfs.enableUnstable.