Add d2 diagramming language
This commit is contained in:
parent
61e60e395c
commit
27eb76e00e
54
nix/base-system/d2.nix
Normal file
54
nix/base-system/d2.nix
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
{ lib
|
||||||
|
, buildGoModule
|
||||||
|
, fetchFromGitHub
|
||||||
|
, installShellFiles
|
||||||
|
, git
|
||||||
|
, testers
|
||||||
|
, d2
|
||||||
|
}:
|
||||||
|
|
||||||
|
buildGoModule rec {
|
||||||
|
pname = "d2";
|
||||||
|
version = "0.6.3";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "terrastruct";
|
||||||
|
repo = pname;
|
||||||
|
rev = "v${version}";
|
||||||
|
hash = "sha256-GImv4OJHanj6dKtAJpTaGLrR4AaVTboiYHwRdh/gXaU";
|
||||||
|
};
|
||||||
|
|
||||||
|
vendorHash = "sha256-T7eki06fQuGvYIJKvBJsIkFS1fQ9Jbv+ieUSr2vupqg=";
|
||||||
|
|
||||||
|
excludedPackages = [ "./e2etests" ];
|
||||||
|
|
||||||
|
ldflags = [
|
||||||
|
"-s"
|
||||||
|
"-w"
|
||||||
|
"-X oss.terrastruct.com/d2/lib/version.Version=v${version}"
|
||||||
|
];
|
||||||
|
|
||||||
|
nativeBuildInputs = [ installShellFiles ];
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
installManPage ci/release/template/man/d2.1
|
||||||
|
'';
|
||||||
|
|
||||||
|
nativeCheckInputs = [ git ];
|
||||||
|
|
||||||
|
preCheck = ''
|
||||||
|
# See https://github.com/terrastruct/d2/blob/master/docs/CONTRIBUTING.md#running-tests.
|
||||||
|
export TESTDATA_ACCEPT=1
|
||||||
|
'';
|
||||||
|
|
||||||
|
passthru.tests.version = testers.testVersion {
|
||||||
|
package = d2;
|
||||||
|
version = "v${version}";
|
||||||
|
};
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "A modern diagram scripting language that turns text to diagrams";
|
||||||
|
homepage = "https://d2lang.com";
|
||||||
|
license = licenses.mpl20;
|
||||||
|
};
|
||||||
|
}
|
@ -40,6 +40,7 @@
|
|||||||
inherit (pkgs.tree-sitter) buildGrammar;
|
inherit (pkgs.tree-sitter) buildGrammar;
|
||||||
inherit (pkgs) fetchFromGitHub;
|
inherit (pkgs) fetchFromGitHub;
|
||||||
};
|
};
|
||||||
|
d2-lang = pkgs.callPackage ./d2.nix {};
|
||||||
# TODO(jwall): When this actually builds we should use it.
|
# TODO(jwall): When this actually builds we should use it.
|
||||||
#nvim-treesitter-powershell = pkgs.callPackage ./nvim-powershell.nix {
|
#nvim-treesitter-powershell = pkgs.callPackage ./nvim-powershell.nix {
|
||||||
# inherit (pkgs.tree-sitter) buildGrammar;
|
# inherit (pkgs.tree-sitter) buildGrammar;
|
||||||
@ -193,6 +194,7 @@ EOF";
|
|||||||
})
|
})
|
||||||
lua-language-server
|
lua-language-server
|
||||||
jdk
|
jdk
|
||||||
|
d2-lang
|
||||||
plantuml-c4
|
plantuml-c4
|
||||||
texlive.combined.scheme-basic
|
texlive.combined.scheme-basic
|
||||||
nssTools
|
nssTools
|
||||||
|
6
nix/darwin/flake.lock
generated
6
nix/darwin/flake.lock
generated
@ -36,12 +36,12 @@
|
|||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1,
|
"lastModified": 1,
|
||||||
"narHash": "sha256-SL1y1rZnHBuBxRGN51dYZnM9F5HUBLUXLm0MvaKW3eU=",
|
"narHash": "sha256-oYMNKaAUEjuXaevB25lSy4tTg047aKzr7dotcL573Vw=",
|
||||||
"path": "/nix/store/45f3c4yrah5v22ka0ax58qrgxjz4h50b-source/nix/base-system",
|
"path": "/nix/store/jhrragm07slg62sy6c9726zwwpxfzrs4-source/nix/base-system",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/nix/store/45f3c4yrah5v22ka0ax58qrgxjz4h50b-source/nix/base-system",
|
"path": "/nix/store/jhrragm07slg62sy6c9726zwwpxfzrs4-source/nix/base-system",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user