tools/pkgs/d2/d2plugin-tala.nix

37 lines
1 KiB
Nix
Raw Normal View History

2022-12-13 14:18:53 +03:00
{ system, stdenv, lib, fetchurl, installShellFiles }:
let
platform = if stdenv.isLinux then "linux" else "darwin";
arch = if lib.hasPrefix "x86_" system then "amd64" else "arm64";
2022-12-26 23:26:32 +03:00
version = "0.2.9";
2022-12-13 14:18:53 +03:00
fileName = "tala-v${version}-${platform}-${arch}.tar.gz";
in
stdenv.mkDerivation {
pname = "d2plugin-tala";
inherit version;
src = fetchurl {
url = "https://github.com/terrastruct/TALA/releases/download/v${version}/${fileName}";
2022-12-26 23:26:32 +03:00
sha256 = "sha256-u5wR71Nga9s0hFfAsUlSTTswbwVmtlDXU7vrVesX/Gs=";
2022-12-13 14:18:53 +03:00
};
nativeBuildInputs = [ installShellFiles ];
phases = [ "unpackPhase" "installPhase" ];
unpackPhase = "tar --strip-component=1 -xf $src";
installPhase = ''
mkdir -p $out/bin
2022-12-13 23:14:30 +03:00
install -Dm555 bin/d2plugin-tala $out/bin
2022-12-13 14:18:53 +03:00
installManPage man/d2plugin-tala.1
installManPage man/tala.1
'';
meta = with lib; {
description = "A diagram layout engine designed specifically for software architecture diagrams";
homepage = "https://terrastruct.com/tala";
license = licenses.unfree;
};
}