@@ -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}