depot/third_party/nixpkgs/pkgs/tools/text/d2/default.nix
Default email 87f9c27ba9 Project import generated by Copybara.
GitOrigin-RevId: fe2ecaf706a5907b5e54d979fbde4924d84b65fc
2023-04-12 14:48:02 +02:00

44 lines
918 B
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, testers
, d2
}:
buildGoModule rec {
pname = "d2";
version = "0.3.0";
src = fetchFromGitHub {
owner = "terrastruct";
repo = pname;
rev = "v${version}";
hash = "sha256-ll6kOmHJZRsN6DkQRAUXyxz61tjwwi+p5eOuLfGDpI8=";
};
vendorHash = "sha256-jfGolYHWX/9Zr5JHiWl8mCfaaRT2AU8v32PtgM1KI8c=";
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 ];
};
}