Commit 130fa0ba authored by lelgenio's avatar lelgenio Committed by Cole Helbling
Browse files

mullvad: add shell completion

parent 80097988
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -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.