about summary refs log tree commit diff
path: root/pkgs/development/tools/trunk-io
diff options
context:
space:
mode:
authorAaron Jheng <wentworth@outlook.com>2022-10-07 08:37:37 +0000
committerAaron Jheng <wentworth@outlook.com>2022-10-28 03:40:58 +0000
commit5ab95b1b930240f8be50e3652cc1a5778490d1cf (patch)
tree751cf5c400ee2cdd80028de87690c729d31dfd8a /pkgs/development/tools/trunk-io
parent1e684b371cf05300bc2b432f958f285855bac8fb (diff)
downloadnixlib-5ab95b1b930240f8be50e3652cc1a5778490d1cf.tar
nixlib-5ab95b1b930240f8be50e3652cc1a5778490d1cf.tar.gz
nixlib-5ab95b1b930240f8be50e3652cc1a5778490d1cf.tar.bz2
nixlib-5ab95b1b930240f8be50e3652cc1a5778490d1cf.tar.lz
nixlib-5ab95b1b930240f8be50e3652cc1a5778490d1cf.tar.xz
nixlib-5ab95b1b930240f8be50e3652cc1a5778490d1cf.tar.zst
nixlib-5ab95b1b930240f8be50e3652cc1a5778490d1cf.zip
trunk-io: init at 1.2.2
Diffstat (limited to 'pkgs/development/tools/trunk-io')
-rw-r--r--pkgs/development/tools/trunk-io/default.nix28
-rwxr-xr-xpkgs/development/tools/trunk-io/update.sh7
2 files changed, 35 insertions, 0 deletions
diff --git a/pkgs/development/tools/trunk-io/default.nix b/pkgs/development/tools/trunk-io/default.nix
new file mode 100644
index 000000000000..293a73ceff5a
--- /dev/null
+++ b/pkgs/development/tools/trunk-io/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "trunk-io";
+  version = "1.2.2";
+
+  src = fetchurl {
+    url = "https://trunk.io/releases/launcher/${version}/trunk";
+    sha256 = "sha256-+A9FUqcxF/zji2QGD50avYSAib4sq8u6R50YzRailMc=";
+  };
+
+  dontUnpack = true;
+  dontConfigure = true;
+  dontBuild = true;
+
+  installPhase = ''
+    install -D $src $out/bin/trunk
+  '';
+
+  passthru.updateScript = ./update.sh;
+
+  meta = with lib; {
+    homepage = "https://trunk.io/";
+    description = "Developer experience toolkit used to check, test, merge, and monitor code";
+    license = licenses.unfree;
+    maintainers = with maintainers; [ aaronjheng ];
+  };
+}
diff --git a/pkgs/development/tools/trunk-io/update.sh b/pkgs/development/tools/trunk-io/update.sh
new file mode 100755
index 000000000000..9110bb633527
--- /dev/null
+++ b/pkgs/development/tools/trunk-io/update.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p curl pcre common-updater-scripts
+
+set -eu -o pipefail
+
+version="$(curl -fsSL https://trunk.io/releases/trunk | grep -Fi 'readonly TRUNK_LAUNCHER_VERSION=' | pcregrep -o1 '"(\d+(?:\.\d+)+)"')"
+update-source-version trunk-io "$version"