nixpkgs/pkgs/applications/networking/twingate/default.nix
Twingate Build Bot b22003dcc4
twingate: 1.0.83 -> 2023.227.93198 (#249324)
* twingate: 1.0.83 -> 2023.227.93198

* - Preserve existing changes

* Update pkgs/applications/networking/twingate/default.nix

---------

Co-authored-by: Anton Shkurenko <anton@twingate.com>
Co-authored-by: Ilan Joselevich <personal@ilanjoselevich.com>
2023-08-17 15:55:40 +03:00

63 lines
1.1 KiB
Nix

{ autoPatchelfHook
, curl
, dpkg
, dbus
, fetchurl
, lib
, libnl
, udev
, cryptsetup
, stdenv
, nixosTests
}:
stdenv.mkDerivation rec {
pname = "twingate";
version = "2023.227.93197";
src = fetchurl {
url = "https://binaries.twingate.com/client/linux/DEB/x86_64/${version}/twingate-amd64.deb";
hash = "sha256-YV56U+RXpTOJvyufVKtTY1c460//ZJcifq2XroTQLXU=";
};
buildInputs = [
dbus
curl
libnl
udev
cryptsetup
];
nativeBuildInputs = [
dpkg
autoPatchelfHook
];
postPatch = ''
while read file; do
substituteInPlace "$file" \
--replace "/usr/bin" "$out/bin" \
--replace "/usr/sbin" "$out/bin"
done < <(find etc usr/lib usr/share -type f)
'';
installPhase = ''
mkdir $out
mv etc $out/
mv usr/bin $out/bin
mv usr/sbin/* $out/bin
mv usr/lib $out/lib
mv usr/share $out/share
'';
passthru.tests = { inherit (nixosTests) twingate; };
meta = with lib; {
description = "Twingate Client";
homepage = "https://twingate.com";
license = licenses.unfree;
maintainers = with maintainers; [ tonyshkurenko ];
platforms = [ "x86_64-linux" ];
};
}