3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/text/d2/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
918 B
Nix
Raw Normal View History

{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
2022-12-07 13:59:02 +00:00
, testers
, d2
}:
buildGoModule rec {
pname = "d2";
2022-12-20 01:12:40 +00:00
version = "0.1.2";
src = fetchFromGitHub {
owner = "terrastruct";
repo = pname;
rev = "v${version}";
2022-12-20 01:12:40 +00:00
hash = "sha256-O3T26Stau168hP7Hhv2bayamXQvaFD6feyW5AYoHf0U=";
};
2022-12-20 01:12:40 +00:00
vendorHash = "sha256-k9zaZ28vs3R5usWUW5N78zz0PuP5UrYEhgXxpQ+v5sE=";
ldflags = [
"-s"
"-w"
"-X oss.terrastruct.com/d2/lib/version.Version=${version}"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installManPage ci/release/template/man/d2.1
'';
2022-12-07 13:59:02 +00:00
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 ];
};
}