nixpkgs/pkgs/tools/networking/cloudflare-warp/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

76 lines
1.8 KiB
Nix
Raw Normal View History

{ stdenv
, lib
, fetchurl
, dpkg
, autoPatchelfHook
, makeWrapper
, copyDesktopItems
, makeDesktopItem
, dbus
, nftables
}:
2022-03-18 18:03:47 +01:00
stdenv.mkDerivation rec {
pname = "cloudflare-warp";
version = "2023.1.133";
2022-03-18 18:03:47 +01:00
src = fetchurl {
url = "https://pkg.cloudflareclient.com/uploads/cloudflare_warp_2023_1_133_1_amd64_734c1ff709.deb";
sha256 = "sha256-Yo1JnbXi9vbYYAkmwk4S7JZZE45SV4p4dB55Rt+w+LA=";
2022-03-18 18:03:47 +01:00
};
nativeBuildInputs = [
dpkg
autoPatchelfHook
makeWrapper
copyDesktopItems
2022-03-18 18:03:47 +01:00
];
buildInputs = [ dbus ];
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
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"
2022-03-18 18:03:47 +01:00
runHook postInstall
'';
postInstall = ''
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";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
2022-03-18 18:03:47 +01:00
license = licenses.unfree;
maintainers = with maintainers; [ wolfangaukang ];
platforms = [ "x86_64-linux" ];
};
}