summary refs log tree commit diff
path: root/pkgs/os-specific/linux/zfs
diff options
context:
space:
mode:
authoradisbladis <adisbladis@gmail.com>2022-03-11 10:36:10 +1200
committeradisbladis <adisbladis@gmail.com>2022-03-11 11:25:19 +1200
commitac74ab0236bb83bbea64538a70ae3f61c0e85235 (patch)
treeb3c415acf168b6f2e1d20c154c4a26cab3c51344 /pkgs/os-specific/linux/zfs
parent9097ed78c025ac5f13ad117dbc59e08d76e2579e (diff)
downloadnixpkgs-ac74ab0236bb83bbea64538a70ae3f61c0e85235.tar
nixpkgs-ac74ab0236bb83bbea64538a70ae3f61c0e85235.tar.gz
nixpkgs-ac74ab0236bb83bbea64538a70ae3f61c0e85235.tar.bz2
nixpkgs-ac74ab0236bb83bbea64538a70ae3f61c0e85235.tar.lz
nixpkgs-ac74ab0236bb83bbea64538a70ae3f61c0e85235.tar.xz
nixpkgs-ac74ab0236bb83bbea64538a70ae3f61c0e85235.tar.zst
nixpkgs-ac74ab0236bb83bbea64538a70ae3f61c0e85235.zip
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.
Diffstat (limited to 'pkgs/os-specific/linux/zfs')
-rw-r--r--pkgs/os-specific/linux/zfs/default.nix11
1 files changed, 6 insertions, 5 deletions
diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix
index 7341240f95a..16aed8e4a76 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.