git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #93276 from xtruder/pkgs/protonvpn-linux-gui/init

protonvpn-gui: init at 2.1.1

commit5e6bc32cbb27176a8d9393ff28cb6502e2d5ff71 authorJaka Hudoklin <offlinehacker@users.noreply.github.com> dateTue 18 Aug 2020, 08:42 (6 years ago) parent7550aabb488383
4 files changed+112−69
pkgs/applications/networking/protonvpn-cli-ng/default.nix−36 pkgs/applications/networking/protonvpn-cli/default.nix+25−32 pkgs/applications/networking/protonvpn-gui/default.nix+86 pkgs/top-level/all-packages.nix+1−1
pkgs/applications/networking/protonvpn-cli-ng/default.nixdeleted−36
@@ -1,36 +0,0 @@
1−{ lib, fetchFromGitHub, python3Packages, openvpn, dialog, iptables }:
2−
3−python3Packages.buildPythonApplication rec {
4− pname = "protonvpn-cli-ng";
5− version = "2.2.4";
6−
7− src = fetchFromGitHub {
8− owner = "protonvpn";
9− repo = "${pname}";
10− rev = "v${version}";
11− sha256 = "08yca0a0prrnrc7ir7ajd56yxvxpcs4m1k8f5kf273f5whgr7wzw";
12− };
13−
14− propagatedBuildInputs = (with python3Packages; [
15− requests
16− docopt
17− setuptools
18− jinja2
19− pythondialog
20− ]) ++ [
21− dialog
22− openvpn
23− iptables
24− ];
25−
26− # No tests
27− doCheck = false;
28−
29− meta = with lib; {
30− description = "Linux command-line client for ProtonVPN";
31− homepage = "https://github.com/protonvpn/protonvpn-cli-ng";
32− maintainers = with maintainers; [ jtcoolen jefflabonte ];
33− license = licenses.gpl3;
34− platforms = platforms.unix;
35− };
36−}
pkgs/applications/networking/protonvpn-cli/default.nix+25−32
@@ -1,43 +1,36 @@
1−{ stdenv, lib, fetchFromGitHub, makeWrapper, coreutils
2−, openvpn, python, dialog, wget, update-resolv-conf }:
1+{ lib, fetchFromGitHub, python3Packages, openvpn, dialog, iptables }:
32
4−let
5− expectedUpdateResolvPath = "/etc/openvpn/update-resolv-conf";
6− actualUpdateResolvePath = "${update-resolv-conf}/libexec/openvpn/update-resolv-conf";
7−
8−in stdenv.mkDerivation rec {
9− name = "protonvpn-cli";
10− version = "1.1.2";
3+python3Packages.buildPythonApplication rec {
4+ pname = "protonvpn-linux-cli";
5+ version = "2.2.4";
116
127 src = fetchFromGitHub {
13− owner = "ProtonVPN";
14− repo = "protonvpn-cli";
8+ owner = "protonvpn";
9+ repo = "linux-cli";
1510 rev = "v${version}";
16− sha256 = "0xvflr8zf267n3dv63nkk4wjxhbckw56sqmyca3krf410vrd7zlv";
11+ sha256 = "08yca0a0prrnrc7ir7ajd56yxvxpcs4m1k8f5kf273f5whgr7wzw";
1712 };
1813
19− nativeBuildInputs = [ makeWrapper ];
14+ propagatedBuildInputs = (with python3Packages; [
15+ requests
16+ docopt
17+ setuptools
18+ jinja2
19+ pythondialog
20+ ]) ++ [
21+ dialog
22+ openvpn
23+ iptables
24+ ];
2025
21− installPhase = ''
22− mkdir -p "$out/bin"
23− substituteInPlace protonvpn-cli.sh \
24− --replace ${expectedUpdateResolvPath} ${actualUpdateResolvePath} \
25− --replace \$UID 0 \
26− --replace /etc/resolv.conf /dev/null \
27− --replace \
28− " echo \"Connecting...\"" \
29− " sed -ri 's@${expectedUpdateResolvPath}@${actualUpdateResolvePath}@g' \"\$openvpn_config\"; echo \"Connecting...\""
30− cp protonvpn-cli.sh "$out/bin/protonvpn-cli"
31− wrapProgram $out/bin/protonvpn-cli \
32− --prefix PATH : ${lib.makeBinPath [ coreutils openvpn python dialog wget update-resolv-conf ]}
33− ln -s "$out/bin/protonvpn-cli" "$out/bin/pvpn"
34− '';
26+ # No tests
27+ doCheck = false;
3528
36− meta = with stdenv.lib; {
37− description = "ProtonVPN Command-Line Tool";
38− homepage = "https://github.com/ProtonVPN/protonvpn-cli";
39− maintainers = with maintainers; [ caugner ];
40− license = licenses.mit;
29+ meta = with lib; {
30+ description = "Linux command-line client for ProtonVPN";
31+ homepage = "https://github.com/protonvpn/linux-cli";
32+ maintainers = with maintainers; [ jtcoolen jefflabonte ];
33+ license = licenses.gpl3;
4134 platforms = platforms.unix;
4235 };
4336}
pkgs/applications/networking/protonvpn-gui/default.nixnew file+86
@@ -0,0 +1,86 @@
1+{ lib, fetchFromGitHub, makeDesktopItem, makeWrapper, imagemagick
2+, python3Packages, wrapGAppsHook, protonvpn-cli, gtk3, pango
3+, gobject-introspection, libnotify, libappindicator-gtk3
4+, procps, openvpn }:
5+
6+let
7+ extraPath = lib.makeBinPath [ procps openvpn ];
8+
9+in python3Packages.buildPythonApplication rec {
10+ pname = "protonvpn-linux-gui";
11+ version = "2.1.1";
12+
13+ src = fetchFromGitHub {
14+ owner = "protonvpn";
15+ repo = "linux-gui";
16+ rev = "v${version}";
17+ sha256 = "avo5/2eq53HSHCnnjtxrsmpURtHvxmLZn2BxActImGY=";
18+ };
19+
20+ desktopItem = makeDesktopItem {
21+ name = "ProtonVPN";
22+ desktopName = "ProtonVPN GUI";
23+ type = "Application";
24+ exec = "protonvpn-gui";
25+ icon = "protonvpn";
26+ categories = "Network;";
27+ terminal = "false";
28+ };
29+
30+ trayDesktopItem = makeDesktopItem {
31+ name = "ProtonVPN Tray";
32+ desktopName = "ProtonVPN Tray";
33+ type = "Application";
34+ exec = "protonvpn-tray";
35+ icon = "protonvpn";
36+ categories = "Network;";
37+ terminal = "false";
38+ };
39+
40+ nativeBuildInputs = [ wrapGAppsHook makeWrapper imagemagick ];
41+
42+ propagatedBuildInputs = (with python3Packages; [
43+ pygobject3
44+ pycairo
45+ requests
46+ configparser
47+ ]) ++ [
48+ protonvpn-cli
49+ gtk3
50+ gobject-introspection
51+ libnotify
52+ libappindicator-gtk3
53+ ];
54+
55+ prePatch = ''
56+ # if pkexec is used, we want to have more time to enter password
57+ substituteInPlace linux_gui/services/login_service.py --replace 'timeout=8' 'timeout=30'
58+ '';
59+
60+ postInstall = ''
61+ # wrap binaries with extra required path
62+ wrapProgram "$out/bin/protonvpn-tray" --prefix PATH ":" ${extraPath}
63+ wrapProgram "$out/bin/protonvpn-gui" --prefix PATH ":" ${extraPath}
64+
65+ # install desktop files
66+ mkdir -p $out/share/applications
67+ cp "$desktopItem/share/applications/ProtonVPN.desktop" $out/share/applications/protonvpn-gui.desktop
68+ cp "$trayDesktopItem/share/applications/ProtonVPN Tray.desktop" $out/share/applications/protonvpn-tray.desktop
69+
70+ # create icons
71+ for size in 16 32 48 64 72 96 128 192 512 1024; do
72+ mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
73+ convert -resize "$size"x"$size" \
74+ linux_gui/resources/img/logo/protonvpn_logo.png \
75+ $out/share/icons/hicolor/"$size"x"$size"/apps/protonvpn.png
76+ done
77+ '';
78+
79+ meta = with lib; {
80+ description = "Linux GUI for ProtonVPN, written in Python.";
81+ homepage = "https://github.com/ProtonVPN/linux-gui";
82+ maintainers = with maintainers; [ offline ];
83+ license = licenses.gpl3;
84+ platforms = platforms.linux;
85+ };
86+}
pkgs/top-level/all-packages.nix+1−1
@@ -22244,7 +22244,7 @@ in
2224422244
2224522245 protonvpn-cli = callPackage ../applications/networking/protonvpn-cli { };
2224622246
22247− protonvpn-cli-ng = callPackage ../applications/networking/protonvpn-cli-ng { };
22247+ protonvpn-gui = callPackage ../applications/networking/protonvpn-gui { };
2224822248
2224922249 ps2client = callPackage ../applications/networking/ps2client { };
2225022250