2021-06-27 09:46:52 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub }:
|
2020-08-13 18:45:40 +00:00
|
|
|
|
2021-10-17 11:31:01 +00:00
|
|
|
let
|
2021-11-03 12:43:23 +00:00
|
|
|
srcInfo = lib.importJSON ./src.json;
|
2021-10-17 11:31:01 +00:00
|
|
|
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
|
|
|
|
2021-10-17 11:31:01 +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";
|
2020-11-21 14:17:44 +00:00
|
|
|
repo = pname;
|
2020-08-13 18:45:40 +00:00
|
|
|
rev = "v${version}";
|
2021-10-17 11:31:01 +00:00
|
|
|
inherit (srcInfo) sha256;
|
2021-06-27 09:46:52 +00:00
|
|
|
};
|
2020-11-21 14:17:44 +00:00
|
|
|
|
2023-09-21 14:23:40 +00:00
|
|
|
vendorHash = "sha256-Bol5yMvNYuoVnSjEgf3h6X4CeUooy2Hpdy3SCaNXXOE=";
|
2021-10-17 11:29:00 +00:00
|
|
|
|
|
|
|
modRoot = "./cmd/chroma";
|
2020-08-13 18:45:40 +00:00
|
|
|
|
2021-10-17 11:31:01 +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
|
|
|
};
|
|
|
|
}
|