From ba6104664022f914662df92a4efdc6057a8ed3b7 Mon Sep 17 00:00:00 2001 From: Will Fancher Date: Fri, 6 Sep 2024 15:41:31 -0400 Subject: [PATCH] zfs: Fix bash completions with 2.1 (cherry picked from commit cf572e0f31924d72264e85365c318758b81f7b73) --- pkgs/os-specific/linux/zfs/generic.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/os-specific/linux/zfs/generic.nix b/pkgs/os-specific/linux/zfs/generic.nix index 28c24c65188f1..0973cd2a95c4b 100644 --- a/pkgs/os-specific/linux/zfs/generic.nix +++ b/pkgs/os-specific/linux/zfs/generic.nix @@ -182,10 +182,11 @@ let # Remove tests because they add a runtime dependency on gcc rm -rf $out/share/zfs/zfs-tests - # Add Bash completions. - install -v -m444 -D -t $out/share/bash-completion/completions contrib/bash_completion.d/zfs - '' + optionalString (lib.versionOlder version "2.2.6") '' - (cd $out/share/bash-completion/completions; ln -s zfs zpool) + ${optionalString (lib.versionOlder version "2.2") '' + # Add Bash completions. + install -v -m444 -D -t $out/share/bash-completion/completions contrib/bash_completion.d/zfs + (cd $out/share/bash-completion/completions; ln -s zfs zpool) + ''} ''; postFixup = let