nixpkgs/pkgs/tools/text/d2/default.nix
2023-01-08 12:26:01 +00:00

45 lines
918 B
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, testers
, d2
}:
buildGoModule rec {
pname = "d2";
version = "0.1.5";
src = fetchFromGitHub {
owner = "terrastruct";
repo = pname;
rev = "v${version}";
hash = "sha256-z7R3lseEPWtBl5wjpMK8okQG31L1k2R/+B9M25TrI6s=";
};
vendorHash = "sha256-t94xCNteYRpbV2GzrD4ppD8xfUV1HTJPkipEzr36CaM=";
ldflags = [
"-s"
"-w"
"-X oss.terrastruct.com/d2/lib/version.Version=${version}"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installManPage ci/release/template/man/d2.1
'';
subPackages = [ "." ];
passthru.tests.version = testers.testVersion { package = d2; };
meta = with lib; {
description = "A modern diagram scripting language that turns text to diagrams";
homepage = "https://d2lang.com";
license = licenses.mpl20;
maintainers = with maintainers; [ dit7ya ];
};
}