summary refs log tree commit diff
path: root/pkgs/applications/networking/protonvpn-gui/default.nix
blob: b6583efe730e63c0109e9b62ae8cc1819265d75d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{ lib, fetchFromGitHub, gobject-introspection, imagemagick,
wrapGAppsHook, python3Packages, gtk3, networkmanager, webkitgtk }:

python3Packages.buildPythonApplication rec {
  pname = "protonvpn-linux-gui";
  version = "1.7.0";

  src = fetchFromGitHub {
    owner = "ProtonVPN";
    repo = "linux-app";
    rev = version;
    sha256 = "sha256-uzooFQBq2mhqTBr/cgea5cVQ889P70sgSk2vjXBQEfw=";
  };

  strictDeps = false;

  nativeBuildInputs = [
    gobject-introspection imagemagick wrapGAppsHook
  ];

  propagatedBuildInputs = with python3Packages; [
    protonvpn-nm-lib
    psutil
  ];

  buildInputs = [
    gtk3 networkmanager webkitgtk
  ];

  postFixup = ''
    # Setting icons
    for size in 16 32 48 64 72 96 128 192 512 1024; do
      mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
      convert -resize $size'x'$size \
        protonvpn_gui/assets/icons/protonvpn-logo.png \
        $out/share/icons/hicolor/$size'x'$size/apps/protonvpn.png
    done

    install -Dm644 protonvpn.desktop -t $out/share/applications/
    substituteInPlace $out/share/applications/protonvpn.desktop \
      --replace 'protonvpn-logo' protonvpn
  '';

  # Project has a dummy test
  doCheck = false;

  meta = with lib; {
    description = "Linux GUI for ProtonVPN, written in Python";
    homepage = "https://github.com/ProtonVPN/linux-app";
    maintainers = with maintainers; [ offline wolfangaukang ];
    license = licenses.gpl3Plus;
    platforms = platforms.linux;
  };
}