tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
protonvpn-gui: build new official client
P. R. d. O
4 years ago
35278505
a26ebd98
+31
-67
1 changed file
expand all
collapse all
unified
split
pkgs
applications
networking
protonvpn-gui
default.nix
+31
-67
pkgs/applications/networking/protonvpn-gui/default.nix
···
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
0
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
0
0
0
0
77
'';
78
79
-
# no tests
80
doCheck = false;
81
82
meta = with lib; {
83
description = "Linux GUI for ProtonVPN, written in Python";
84
-
homepage = "https://github.com/ProtonVPN/linux-gui";
85
-
maintainers = with maintainers; [ offline ];
86
license = licenses.gpl3Plus;
87
platforms = platforms.linux;
88
-
mainProgram = "protonvpn-gui";
89
};
90
}
···
1
+
{ lib, fetchFromGitHub, gobject-introspection, imagemagick,
2
+
wrapGAppsHook, python3Packages, gtk3, networkmanager, webkitgtk }:
0
0
3
4
+
python3Packages.buildPythonApplication rec {
0
0
0
5
pname = "protonvpn-linux-gui";
6
+
version = "1.4.1";
7
8
src = fetchFromGitHub {
9
+
owner = "ProtonVPN";
10
+
repo = "linux-app";
11
+
rev = version;
12
+
sha256 = "sha256-08gXEKm8udgNltRdqvAMFL0pDCWZu/kfl1xGQtZPBCc=";
13
};
14
15
+
strictDeps = false;
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
16
17
+
nativeBuildInputs = [
18
+
gobject-introspection imagemagick wrapGAppsHook
19
+
];
0
20
21
+
propagatedBuildInputs = with python3Packages; [
22
+
protonvpn-nm-lib
23
+
psutil
24
+
];
25
26
+
buildInputs = [
27
+
gtk3 networkmanager webkitgtk
28
+
];
0
29
30
+
postFixup = ''
31
+
# Setting icons
32
for size in 16 32 48 64 72 96 128 192 512 1024; do
33
mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
34
+
convert -resize $size'x'$size \
35
+
protonvpn_gui/assets/icons/protonvpn-logo.png \
36
+
$out/share/icons/hicolor/$size'x'$size/apps/protonvpn.png
37
done
38
+
39
+
install -Dm644 protonvpn.desktop -t $out/share/applications/
40
+
substituteInPlace $out/share/applications/protonvpn.desktop \
41
+
--replace 'protonvpn-logo' protonvpn
42
'';
43
44
+
# Project has a dummy test
45
doCheck = false;
46
47
meta = with lib; {
48
description = "Linux GUI for ProtonVPN, written in Python";
49
+
homepage = "https://github.com/ProtonVPN/linux-app";
50
+
maintainers = with maintainers; [ offline wolfangaukang ];
51
license = licenses.gpl3Plus;
52
platforms = platforms.linux;
0
53
};
54
}