mullvad: add shell completion

This commit is contained in:
lelgenio
2023-03-09 07:24:04 -08:00
committed by Cole Helbling
parent 8009798849
commit 130fa0baaa
@@ -15,6 +15,7 @@
, enableOpenvpn ? true
, openvpn-mullvad
, shadowsocks-rust
, installShellFiles
}:
rustPlatform.buildRustPackage rec {
pname = "mullvad";
@@ -44,6 +45,7 @@ rustPlatform.buildRustPackage rec {
protobuf
makeWrapper
git
installShellFiles
];
buildInputs = [
@@ -59,6 +61,17 @@ rustPlatform.buildRustPackage rec {
ln -s ${libwg}/lib/libwg.a $dest
'';
postInstall = ''
compdir=$(mktemp -d)
for shell in bash zsh fish; do
$out/bin/mullvad shell-completions $shell $compdir
done
installShellCompletion --cmd mullvad \
--bash $compdir/mullvad.bash \
--zsh $compdir/_mullvad \
--fish $compdir/mullvad.fish
'';
postFixup =
# Place all binaries in the 'mullvad-' namespace, even though these
# specific binaries aren't used in the lifetime of the program.