about summary refs log tree commit diff
path: root/pkgs/applications/networking/mullvad
diff options
context:
space:
mode:
authorTarCV <tarcv@users.noreply.github.com>2023-07-11 08:21:38 +0300
committerCole Helbling <cole.e.helbling@outlook.com>2023-07-18 15:02:05 -0700
commit369fbaae615ca2c51a8e3ed7b030099ed7906540 (patch)
treed654558996fce8ba420b7808c75a319efbdb8a0e /pkgs/applications/networking/mullvad
parentf362d21d6f1a1e819ef3f56fa94eb1c2b16d5bf0 (diff)
mullvad.openvpn-mullvad: Update configureFlags to match the flags from mullvadvpn-app-binaries on Linux too
Diffstat (limited to 'pkgs/applications/networking/mullvad')
-rw-r--r--pkgs/applications/networking/mullvad/openvpn.nix23
1 files changed, 15 insertions, 8 deletions
diff --git a/pkgs/applications/networking/mullvad/openvpn.nix b/pkgs/applications/networking/mullvad/openvpn.nix
index 3d290d49ec8c7..ad33172801690 100644
--- a/pkgs/applications/networking/mullvad/openvpn.nix
+++ b/pkgs/applications/networking/mullvad/openvpn.nix
@@ -1,13 +1,17 @@
 { lib
+, stdenv
 , openvpn
 , fetchpatch
 , fetchurl
 , iproute2
+, libnl
 , autoreconfHook
+, pkg-config
 }:
 
 openvpn.overrideAttrs (oldAttrs:
   let
+    inherit (lib) optional;
     fetchMullvadPatch = { commit, sha256 }: fetchpatch {
       url = "https://github.com/mullvad/openvpn/commit/${commit}.patch";
       inherit sha256;
@@ -24,13 +28,15 @@ openvpn.overrideAttrs (oldAttrs:
 
     nativeBuildInputs = oldAttrs.nativeBuildInputs or [ ] ++ [
       autoreconfHook
+      pkg-config
     ];
 
-    buildInputs = oldAttrs.buildInputs or [ ] ++ [
-       iproute2
-    ];
+    buildInputs = oldAttrs.buildInputs or [ ]
+       ++ optional stdenv.isLinux [ libnl.dev ];
+
+    configureFlags = [
+      # Assignement instead of appending to make sure to use exactly the flags required by mullvad
 
-    configureFlags = oldAttrs.configureFlags  or [ ] ++ [
       # Flags are based on https://github.com/mullvad/mullvadvpn-app-binaries/blob/main/Makefile#L17
       "--enable-static"
       "--disable-shared"
@@ -46,10 +52,11 @@ openvpn.overrideAttrs (oldAttrs:
       "--disable-lzo"
       "--disable-lz4"
       "--enable-comp-stub"
-
-      # TODO: Use '--enable-dco --disable-iproute2' on Linux, see https://github.com/mullvad/mullvadvpn-app-binaries/blob/main/Makefile#L35
-      "--enable-iproute2"
-      "IPROUTE=${iproute2}/sbin/ip"
+    ]
+    ++ optional stdenv.isLinux [
+      # Flags are based on https://github.com/mullvad/mullvadvpn-app-binaries/blob/main/Makefile#L35
+      "--enable-dco" # requires libnl
+      "--disable-iproute2"
     ];
 
     patches = oldAttrs.patches or [ ] ++ [