nixpkgs/pkgs/applications/networking/mullvad-vpn/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

93 lines
2.0 KiB
Nix

{ stdenv, lib, makeWrapper, fetchurl, dpkg
, alsaLib, atk, cairo, cups, dbus, expat, fontconfig, freetype
, gdk-pixbuf, glib, gnome2, pango, nspr, nss, gtk3
, xorg, autoPatchelfHook, systemd, libnotify, libappindicator
}:
let deps = [
alsaLib
atk
cairo
cups
dbus
expat
fontconfig
freetype
gdk-pixbuf
glib
gnome2.GConf
pango
gtk3
libappindicator
libnotify
xorg.libX11
xorg.libXScrnSaver
xorg.libXcomposite
xorg.libXcursor
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXi
xorg.libXrandr
xorg.libXrender
xorg.libXtst
xorg.libxcb
nspr
nss
systemd
];
in
stdenv.mkDerivation rec {
pname = "mullvad-vpn";
version = "2020.7";
src = fetchurl {
url = "https://www.mullvad.net/media/app/MullvadVPN-${version}_amd64.deb";
sha256 = "07vryz1nq8r4m5y9ry0d0v62ykz1cnnsv628x34yvwiyazbav4ri";
};
nativeBuildInputs = [
autoPatchelfHook
dpkg
];
buildInputs = deps;
dontBuild = true;
dontConfigure = true;
unpackPhase = "dpkg-deb -x $src .";
runtimeDependencies = [ (lib.getLib systemd) libnotify libappindicator ];
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
sed -i 's|\/opt\/Mullvad.*VPN|'$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
runHook postInstall
'';
meta = with lib; {
homepage = "https://github.com/mullvad/mullvadvpn-app";
description = "Client for Mullvad VPN";
changelog = "https://github.com/mullvad/mullvadvpn-app/blob/${version}/CHANGELOG.md";
license = licenses.gpl3;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ Br1ght0ne ];
};
}