summary refs log tree commit diff
path: root/pkgs/applications/networking/mullvad-vpn/default.nix
diff options
context:
space:
mode:
authorBernardo Meurer <bernardo@meurer.org>2022-01-23 21:23:52 -0800
committerBernardo Meurer <bernardo@meurer.org>2022-01-23 21:23:52 -0800
commit76c35ec8391401d83bc41a515f1199ce6ab04c1d (patch)
tree8397284c24923806181239c9b9f91f304ee8fb34 /pkgs/applications/networking/mullvad-vpn/default.nix
parente8d0231396d1642cefe7940b2897451fbf128729 (diff)
mullvad-vpn: use makeWrapper instead of env hack
Diffstat (limited to 'pkgs/applications/networking/mullvad-vpn/default.nix')
-rw-r--r--pkgs/applications/networking/mullvad-vpn/default.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkgs/applications/networking/mullvad-vpn/default.nix b/pkgs/applications/networking/mullvad-vpn/default.nix
index fd08817f026d1..c196f6bdbda95 100644
--- a/pkgs/applications/networking/mullvad-vpn/default.nix
+++ b/pkgs/applications/networking/mullvad-vpn/default.nix
@@ -2,6 +2,7 @@
 , alsa-lib, atk, cairo, cups, dbus, expat, fontconfig, freetype
 , gdk-pixbuf, glib, gnome2, pango, nspr, nss, gtk3, mesa
 , xorg, autoPatchelfHook, systemd, libnotify, libappindicator
+, makeWrapper
 }:
 
 let deps = [
@@ -53,6 +54,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     autoPatchelfHook
     dpkg
+    makeWrapper
   ];
 
   buildInputs = deps;
@@ -73,12 +75,14 @@ stdenv.mkDerivation rec {
     mv usr/bin/* $out/bin
     mv opt/Mullvad\ VPN/* $out/share/mullvad
 
-    sed -i 's|"\/opt\/Mullvad.*VPN|env MULLVAD_DISABLE_UPDATE_NOTIFICATION=1 "'$out'/bin|g' $out/share/applications/mullvad-vpn.desktop
-
     ln -s $out/share/mullvad/mullvad-{gui,vpn} $out/bin/
     ln -s $out/share/mullvad/resources/mullvad-daemon $out/bin/mullvad-daemon
     ln -sf $out/share/mullvad/resources/mullvad-problem-report $out/bin/mullvad-problem-report
 
+    wrapProgram $out/bin/mullvad-vpn --set MULLVAD_DISABLE_UPDATE_NOTIFICATION 1
+
+    sed -i "s|Exec.*$|Exec=$out/bin/mullvad-vpn $U|" $out/share/applications/mullvad-vpn.desktop
+
     runHook postInstall
   '';