2021-07-03 03:11:41 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub }:
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
let
|
|
|
|
srcInfo = lib.importJSON ./src.json;
|
|
|
|
in
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "chroma";
|
2022-06-26 10:26:21 +00:00
|
|
|
version = "2.2.0";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
# To update:
|
|
|
|
# nix-prefetch-git --rev v${version} https://github.com/alecthomas/chroma.git > src.json
|
2020-09-25 04:45:31 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "alecthomas";
|
2020-12-25 13:55:36 +00:00
|
|
|
repo = pname;
|
2020-09-25 04:45:31 +00:00
|
|
|
rev = "v${version}";
|
2021-12-06 16:07:01 +00:00
|
|
|
inherit (srcInfo) sha256;
|
2021-07-03 03:11:41 +00:00
|
|
|
};
|
2020-12-25 13:55:36 +00:00
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
vendorSha256 = "1f5pv32vg0ci71kj5bbg24ymmm12yi6r07n8blj47qz8203l5yab";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
modRoot = "./cmd/chroma";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2021-12-06 16:07: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-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/alecthomas/chroma";
|
|
|
|
description = "A general purpose syntax highlighter in pure Go";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.sternenseemann ];
|
|
|
|
};
|
|
|
|
}
|