nixpkgs/pkgs/by-name/mu/mullvad-vpn/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

170 lines
3.3 KiB
Nix
Raw Normal View History

2024-11-30 17:16:30 +00:00
{
stdenv,
lib,
fetchurl,
dpkg,
alsa-lib,
atk,
cairo,
cups,
dbus,
expat,
fontconfig,
freetype,
gdk-pixbuf,
glib,
pango,
nspr,
nss,
gtk3,
mesa,
libGL,
wayland,
xorg,
autoPatchelfHook,
systemd,
libnotify,
libappindicator,
makeWrapper,
coreutils,
gnugrep,
2024-11-30 17:40:02 +00:00
versionCheckHook,
2019-06-18 07:26:35 +00:00
}:
2023-02-20 11:50:07 +00:00
let
deps = [
alsa-lib
2019-06-18 07:26:35 +00:00
atk
cairo
cups
dbus
expat
fontconfig
freetype
2019-05-22 11:03:39 +00:00
gdk-pixbuf
2019-06-18 07:26:35 +00:00
glib
pango
gtk3
libappindicator
2019-06-18 07:26:35 +00:00
libnotify
2021-04-09 11:32:08 +00:00
mesa
2019-06-18 07:26:35 +00:00
xorg.libX11
xorg.libXScrnSaver
xorg.libXcomposite
xorg.libXcursor
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXi
xorg.libXrandr
xorg.libXrender
xorg.libXtst
xorg.libxcb
2021-12-10 11:38:06 +00:00
xorg.libxshmfence
2019-06-18 07:26:35 +00:00
nspr
nss
systemd
];
2024-11-17 22:37:29 +00:00
version = "2024.7";
2023-06-19 02:46:39 +00:00
2024-11-30 17:16:30 +00:00
selectSystem =
attrs:
attrs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
2023-06-19 02:46:39 +00:00
platform = selectSystem {
x86_64-linux = "amd64";
aarch64-linux = "arm64";
};
hash = selectSystem {
2024-11-17 22:37:29 +00:00
x86_64-linux = "sha256-l6uWrOzMzn8bF5iZzfa/xffLIvAPsCaLwzcRPRW3t0o=";
aarch64-linux = "sha256-/RLTjhkiH9WdYO56njnxQyJ0nSaAq/awrkm0NhctFZY=";
2023-06-19 02:46:39 +00:00
};
2019-06-18 07:26:35 +00:00
in
2023-06-19 02:46:39 +00:00
stdenv.mkDerivation {
2019-06-18 07:26:35 +00:00
pname = "mullvad-vpn";
2023-06-19 02:46:39 +00:00
inherit version;
2019-06-18 07:26:35 +00:00
src = fetchurl {
2023-06-19 02:46:39 +00:00
url = "https://github.com/mullvad/mullvadvpn-app/releases/download/${version}/MullvadVPN-${version}_${platform}.deb";
inherit hash;
2019-06-18 07:26:35 +00:00
};
nativeBuildInputs = [
autoPatchelfHook
dpkg
makeWrapper
2019-06-18 07:26:35 +00:00
];
buildInputs = deps;
dontBuild = true;
dontConfigure = true;
2024-11-30 17:16:30 +00:00
runtimeDependencies = [
(lib.getLib systemd)
libGL
libnotify
libappindicator
wayland
];
2019-06-18 07:26:35 +00:00
installPhase = ''
runHook preInstall
mkdir -p $out/share/mullvad $out/bin
mv usr/share/* $out/share
mv usr/bin/* $out/bin
mv opt/Mullvad\ VPN/* $out/share/mullvad
2019-10-08 17:27:36 +00:00
ln -s $out/share/mullvad/mullvad-{gui,vpn} $out/bin/
ln -sf $out/share/mullvad/resources/mullvad-problem-report $out/bin/mullvad-problem-report
2019-06-18 07:26:35 +00:00
wrapProgram $out/bin/mullvad-vpn \
--set MULLVAD_DISABLE_UPDATE_NOTIFICATION 1 \
2024-11-30 17:16:30 +00:00
--prefix PATH : ${
lib.makeBinPath [
coreutils
gnugrep
]
}
2023-01-22 00:39:32 +00:00
wrapProgram $out/bin/mullvad-daemon \
--set-default MULLVAD_RESOURCE_DIR "$out/share/mullvad/resources"
2023-10-12 21:04:36 +00:00
wrapProgram $out/bin/mullvad-gui \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime=true}}"
2023-10-12 21:04:36 +00:00
sed -i "s|Exec.*$|Exec=$out/bin/mullvad-vpn $U|" $out/share/applications/mullvad-vpn.desktop
2019-06-18 07:26:35 +00:00
runHook postInstall
'';
2024-11-30 17:40:02 +00:00
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgramArg = [ "--version" ];
doInstallCheck = true;
2023-06-19 02:46:39 +00:00
passthru.updateScript = ./update.sh;
2024-11-30 17:40:02 +00:00
meta = {
2019-06-18 07:26:35 +00:00
homepage = "https://github.com/mullvad/mullvadvpn-app";
description = "Client for Mullvad VPN";
changelog = "https://github.com/mullvad/mullvadvpn-app/blob/${version}/CHANGELOG.md";
2024-11-30 17:40:02 +00:00
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.gpl3Only;
platforms = lib.platforms.unix;
2024-11-29 23:04:51 +00:00
badPlatforms = [ lib.systems.inspect.patterns.isDarwin ];
2024-11-30 17:40:02 +00:00
maintainers = with lib.maintainers; [
2024-11-30 17:16:30 +00:00
Br1ght0ne
ymarkus
ataraxiasjel
];
2019-06-18 07:26:35 +00:00
};
}