about summary refs log tree commit diff
path: root/pkgs/applications/networking/twingate
diff options
context:
space:
mode:
authorOleksandr Chupryna <ochupryna@twingate.com>2022-11-04 13:29:03 +0100
committerOleksandr Chupryna <ochupryna@twingate.com>2022-11-04 13:29:03 +0100
commit3abe0af96b10f5a8737ac76bf75523aeab86be76 (patch)
treedabf8c55d5d7dc2bc61871a56bc76cf4836de313 /pkgs/applications/networking/twingate
parente73969607e7fee0e4ff812e6e98e2b597961101f (diff)
downloadnixlib-3abe0af96b10f5a8737ac76bf75523aeab86be76.tar
nixlib-3abe0af96b10f5a8737ac76bf75523aeab86be76.tar.gz
nixlib-3abe0af96b10f5a8737ac76bf75523aeab86be76.tar.bz2
nixlib-3abe0af96b10f5a8737ac76bf75523aeab86be76.tar.lz
nixlib-3abe0af96b10f5a8737ac76bf75523aeab86be76.tar.xz
nixlib-3abe0af96b10f5a8737ac76bf75523aeab86be76.tar.zst
nixlib-3abe0af96b10f5a8737ac76bf75523aeab86be76.zip
twingate: init at 1.0.60
Diffstat (limited to 'pkgs/applications/networking/twingate')
-rw-r--r--pkgs/applications/networking/twingate/default.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/pkgs/applications/networking/twingate/default.nix b/pkgs/applications/networking/twingate/default.nix
new file mode 100644
index 000000000000..33e0820bec9f
--- /dev/null
+++ b/pkgs/applications/networking/twingate/default.nix
@@ -0,0 +1,51 @@
+{ autoPatchelfHook
+, curl
+, dpkg
+, dbus
+, fetchurl
+, lib
+, libnl
+, udev
+, cryptsetup
+, stdenv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "twingate";
+  version = "1.0.60";
+
+  src = fetchurl {
+    url = "https://binaries.twingate.com/client/linux/DEB/${version}/twingate-amd64.deb";
+    sha256 = "b308c422af8a33ecd58e21a10a72c353351a189df67006e38d1ec029a93d5678";
+  };
+
+  buildInputs = [ dbus curl libnl udev cryptsetup ];
+  nativeBuildInputs = [ dpkg autoPatchelfHook ];
+
+  unpackCmd = "mkdir root ; dpkg-deb -x $curSrc root";
+
+  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
+  '';
+
+  meta = with lib; {
+    description = "Twingate Client";
+    homepage = "https://twingate.com";
+    license = licenses.unfree;
+    maintainers = with maintainers; [ tonyshkurenko ];
+    platforms = platforms.linux;
+  };
+}