about summary refs log tree commit diff
path: root/pkgs/applications/networking/mullvad
diff options
context:
space:
mode:
authorCole Helbling <cole.e.helbling@outlook.com>2022-03-26 12:05:21 -0700
committerCole Helbling <cole.e.helbling@outlook.com>2022-04-01 07:39:16 -0700
commit1fc220f69cdcb252b4f0f39b123d59951dc823d4 (patch)
tree49e2963598ea3856366a3990f79bfe0862aac09b /pkgs/applications/networking/mullvad
parenta9c901daadd2bccf5f5ede7e4106995ba2f2237c (diff)
mullvad: fix openvpn support
Also expose `libwg` through `passthru` in the same way as
`openvpn-wireguard`.
Diffstat (limited to 'pkgs/applications/networking/mullvad')
-rw-r--r--pkgs/applications/networking/mullvad/mullvad.nix23
1 files changed, 15 insertions, 8 deletions
diff --git a/pkgs/applications/networking/mullvad/mullvad.nix b/pkgs/applications/networking/mullvad/mullvad.nix
index 6fe37da270c70..801e8602cc95c 100644
--- a/pkgs/applications/networking/mullvad/mullvad.nix
+++ b/pkgs/applications/networking/mullvad/mullvad.nix
@@ -11,6 +11,7 @@
 , libmnl
 , libwg
 , openvpn-mullvad
+, shadowsocks-rust
 }:
 let
   # result of running address_cache as of 02 Mar 2022
@@ -71,14 +72,17 @@ rustPlatform.buildRustPackage rec {
     # Put distributed assets in-place -- specifically, the
     # bootstrap-address-cache is necessary; otherwise, the user will have to run
     # the `address_cache` binary and move the contents into place at
-    # `/var/cache/mullvad-vpn/api-ip-address.txt` manually. `ca.crt` is
-    # necessary for OpenVPN tunnels to work.
-    # XXX: Use of OpenVPN requires their fork of OpenVPN, which can be found at
-    # https://github.com/mullvad/openvpn/tree/mullvad-patches/
+    # `/var/cache/mullvad-vpn/api-ip-address.txt` manually.
     ''
-      mkdir -p $out/share
-      ln -s ${bootstrap-address-cache} $out/share/api-ip-address.txt
-      cp dist-assets/ca.crt $out/share
+      mkdir -p $out/share/mullvad
+      ln -s ${bootstrap-address-cache} $out/share/mullvad/api-ip-address.txt
+    '' +
+    # Files necessary for OpenVPN tunnels to work.
+    ''
+      cp dist-assets/ca.crt $out/share/mullvad
+      ln -s ${openvpn-mullvad}/bin/openvpn $out/share/mullvad
+      ln -s ${shadowsocks-rust}/bin/sslocal $out/share/mullvad
+      ln -s $out/lib/libtalpid_openvpn_plugin.so $out/share/mullvad
     '' +
     # Set the directory where Mullvad will look for its resources by default to
     # `$out/share`, so that we can avoid putting the files in `$out/bin` --
@@ -89,7 +93,10 @@ rustPlatform.buildRustPackage rec {
         --set-default MULLVAD_RESOURCE_DIR "$out/share/mullvad"
     '';
 
-  passthru = { inherit openvpn-mullvad; };
+  passthru = {
+    inherit libwg;
+    inherit openvpn-mullvad;
+  };
 
   meta = with lib; {
     description = "Mullvad VPN command-line client tools";