depot/third_party/nixpkgs/pkgs/tools/networking/cloudflare-warp/default.nix
Default email d2947cfef0 Project import generated by Copybara.
GitOrigin-RevId: 598f83ebeb2235435189cf84d844b8b73e858e0f
2022-10-06 20:32:54 +02:00

59 lines
1.4 KiB
Nix

{ stdenv
, lib
, fetchurl
, dpkg
, autoPatchelfHook
, makeWrapper
, dbus
, nftables
}:
stdenv.mkDerivation rec {
pname = "cloudflare-warp";
version = "2022.8.936";
src = fetchurl {
url = "https://pkg.cloudflareclient.com/uploads/cloudflare_warp_2022_8_936_1_amd64_1923bb9dba.deb";
sha256 = "sha256-ZuJyMl6g8KDwxc9UipH63naJ4dl/84Vhk7ini/VNPno=";
};
nativeBuildInputs = [
dpkg
autoPatchelfHook
makeWrapper
];
buildInputs = [ dbus ];
unpackPhase = ''
dpkg-deb -x ${src} ./
'';
installPhase = ''
runHook preInstall
mv usr $out
mv bin $out
mv etc $out
mv lib/systemd/system $out/lib/systemd/
substituteInPlace $out/lib/systemd/system/warp-svc.service \
--replace "ExecStart=" "ExecStart=$out"
substituteInPlace $out/lib/systemd/user/warp-taskbar.service \
--replace "ExecStart=" "ExecStart=$out"
runHook postInstall
'';
postInstall = ''
wrapProgram $out/bin/warp-svc --prefix PATH : ${lib.makeBinPath [ nftables ]}
'';
meta = with lib; {
description = "Replaces the connection between your device and the Internet with a modern, optimized, protocol";
homepage = "https://pkg.cloudflareclient.com/packages/cloudflare-warp";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
maintainers = with maintainers; [ wolfangaukang ];
platforms = [ "x86_64-linux" ];
};
}