depot/third_party/nixpkgs/pkgs/tools/text/d2/default.nix
Default email a66bca1520 Project import generated by Copybara.
GitOrigin-RevId: 40f79f003b6377bd2f4ed4027dde1f8f922995dd
2022-12-17 11:02:37 +01:00

44 lines
918 B
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, testers
, d2
}:
buildGoModule rec {
pname = "d2";
version = "0.1.1";
src = fetchFromGitHub {
owner = "terrastruct";
repo = pname;
rev = "v${version}";
hash = "sha256-3cglQEJo2rkIJ+ogqliE/JK4SfoeKwB2bNrHRBgDJSU=";
};
vendorHash = "sha256-MyvLHWg7GFSzYMtzgba7Bi7QEijDvK3B+NC84ZU/Jvs=";
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 ];
};
}