nixpkgs/pkgs/tools/text/chroma/default.nix

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

39 lines
937 B
Nix
Raw Normal View History

{ lib, buildGoModule, fetchFromGitHub }:
2020-08-13 18:45:40 +00:00
let
srcInfo = lib.importJSON ./src.json;
in
2020-08-13 18:45:40 +00:00
buildGoModule rec {
pname = "chroma";
2023-07-03 19:12:20 +00:00
version = "2.8.0";
2020-08-13 18:45:40 +00:00
# To update:
# nix-prefetch-git --rev v${version} https://github.com/alecthomas/chroma.git > src.json
2020-08-13 18:45:40 +00:00
src = fetchFromGitHub {
owner = "alecthomas";
repo = pname;
2020-08-13 18:45:40 +00:00
rev = "v${version}";
inherit (srcInfo) sha256;
};
2023-09-21 14:23:40 +00:00
vendorHash = "sha256-Bol5yMvNYuoVnSjEgf3h6X4CeUooy2Hpdy3SCaNXXOE=";
modRoot = "./cmd/chroma";
2020-08-13 18:45:40 +00:00
# substitute version info as done in goreleaser builds
ldflags = [
"-X" "main.version=${version}"
"-X" "main.commit=${srcInfo.rev}"
"-X" "main.date=${srcInfo.date}"
];
2020-08-13 18:45:40 +00:00
meta = with lib; {
homepage = "https://github.com/alecthomas/chroma";
description = "General purpose syntax highlighter in pure Go";
license = licenses.mit;
maintainers = [ maintainers.sternenseemann ];
2023-12-13 12:13:43 +00:00
mainProgram = "chroma";
2020-08-13 18:45:40 +00:00
};
}