2022-09-26 18:17:17 +02:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, dpkg
|
|
|
|
, autoPatchelfHook
|
|
|
|
, makeWrapper
|
2023-02-26 20:00:33 +01:00
|
|
|
, copyDesktopItems
|
|
|
|
, makeDesktopItem
|
2022-09-26 18:17:17 +02:00
|
|
|
, dbus
|
|
|
|
, nftables
|
|
|
|
}:
|
2022-03-18 18:03:47 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "cloudflare-warp";
|
2023-06-24 17:14:32 +02:00
|
|
|
version = "2023.3.470";
|
2022-03-18 18:03:47 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-06-24 17:14:32 +02:00
|
|
|
url = "https://pkg.cloudflareclient.com/pool/jammy/main/c/cloudflare-warp/cloudflare-warp_2023.3.470-1_amd64.deb";
|
|
|
|
hash = "sha256-AYnmisEQKFiEB2iRJifEqRbdzAyBcfrU0ITeUokKLag=";
|
2022-03-18 18:03:47 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
dpkg
|
|
|
|
autoPatchelfHook
|
2022-09-26 18:17:17 +02:00
|
|
|
makeWrapper
|
2023-02-26 20:00:33 +01:00
|
|
|
copyDesktopItems
|
2022-03-18 18:03:47 +01:00
|
|
|
];
|
|
|
|
|
2023-04-16 18:02:32 +02:00
|
|
|
buildInputs = [
|
|
|
|
dbus
|
|
|
|
stdenv.cc.cc.lib
|
|
|
|
];
|
2022-03-18 18:03:47 +01:00
|
|
|
|
2023-02-26 20:00:33 +01:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "com.cloudflare.WarpCli";
|
|
|
|
desktopName = "Cloudflare Zero Trust Team Enrollment";
|
|
|
|
categories = [ "Utility" "Security" "ConsoleOnly" ];
|
|
|
|
noDisplay = true;
|
|
|
|
mimeTypes = [ "x-scheme-handler/com.cloudflare.warp" ];
|
|
|
|
exec = "warp-cli teams-enroll-token %u";
|
|
|
|
startupNotify = false;
|
|
|
|
terminal = true;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-03-18 18:03:47 +01:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mv usr $out
|
|
|
|
mv bin $out
|
2022-09-26 18:17:17 +02:00
|
|
|
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"
|
2022-03-18 18:03:47 +01:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2022-09-26 18:17:17 +02:00
|
|
|
wrapProgram $out/bin/warp-svc --prefix PATH : ${lib.makeBinPath [ nftables ]}
|
2022-03-18 18:03:47 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
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";
|
2022-06-11 13:39:29 +02:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2022-03-18 18:03:47 +01:00
|
|
|
license = licenses.unfree;
|
2023-06-24 17:14:32 +02:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
wolfangaukang
|
|
|
|
devpikachu
|
|
|
|
];
|
2022-03-18 18:03:47 +01:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|