13 , enableOpenvpn ? true
18 rustPlatform.buildRustPackage rec {
22 src = fetchFromGitHub {
24 repo = "mullvadvpn-app";
26 hash = "sha256-syIBYZe+e6i5A6Te51eNKcwwycnRhO1o2tP+z81NYXQ=";
30 lockFile = ./Cargo.lock;
32 "nix-0.26.1" = "sha256-b5bLeZVNbJE7aBnyzl0qvo0mXFeXa4hAZiuT1VJiFLk=";
33 "udp-over-tcp-0.3.0" = "sha256-5PeaM7/zhux1UdlaKpnQ2yIdmFy1n2weV/ux9lSRha4=";
34 "hickory-proto-0.24.0" = "sha256-IqGVoQ1vRruCcaDr82ARkvSo42Pe9Q6iJIWnSd6GqEg=";
52 # talpid-core wants libwg.a in build/lib/{triple}
54 dest=build/lib/${stdenv.hostPlatform.config}
56 ln -s ${libwg}/lib/libwg.a $dest
61 for shell in bash zsh fish; do
62 $out/bin/mullvad shell-completions $shell $compdir
64 installShellCompletion --cmd mullvad \
65 --bash $compdir/mullvad.bash \
66 --zsh $compdir/_mullvad \
67 --fish $compdir/mullvad.fish
71 # Place all binaries in the 'mullvad-' namespace, even though these
72 # specific binaries aren't used in the lifetime of the program.
74 for bin in relay_list translations-converter tunnel-obfuscation; do
75 mv "$out/bin/$bin" "$out/bin/mullvad-$bin"
78 # Files necessary for OpenVPN tunnels to work.
79 lib.optionalString enableOpenvpn ''
80 mkdir -p $out/share/mullvad
81 cp dist-assets/ca.crt $out/share/mullvad
82 ln -s ${openvpn-mullvad}/bin/openvpn $out/share/mullvad
83 ln -s ${shadowsocks-rust}/bin/sslocal $out/share/mullvad
84 ln -s $out/lib/libtalpid_openvpn_plugin.so $out/share/mullvad
86 # Set the directory where Mullvad will look for its resources by default to
87 # `$out/share`, so that we can avoid putting the files in `$out/bin` --
88 # Mullvad defaults to looking inside the directory its binary is located in
91 wrapProgram $out/bin/mullvad-daemon \
92 --set-default MULLVAD_RESOURCE_DIR "$out/share/mullvad"
97 inherit openvpn-mullvad;
101 description = "Mullvad VPN command-line client tools";
102 homepage = "https://github.com/mullvad/mullvadvpn-app";
103 license = licenses.gpl3Only;
104 maintainers = with maintainers; [ cole-h ];