depot/third_party/nixpkgs/pkgs/applications/networking/twingate/default.nix
Default email 23b612e36f Project import generated by Copybara.
GitOrigin-RevId: ae5c332cbb5827f6b1f02572496b141021de335f
2024-01-25 23:12:00 +09:00

62 lines
1.1 KiB
Nix

{ autoPatchelfHook
, curl
, dpkg
, dbus
, fetchurl
, lib
, libnl
, udev
, cryptsetup
, stdenv
, nixosTests
}:
stdenv.mkDerivation rec {
pname = "twingate";
version = "2024.018.111147";
src = fetchurl {
url = "https://binaries.twingate.com/client/linux/DEB/x86_64/${version}/twingate-amd64.deb";
hash = "sha256-lOW4Y2zRP1UGMgBSC3K92mF5172kp0B1nwfRpE1QX/M=";
};
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" ];
};
}