mullvad: add shell completion
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user