2021-06-27 11:46:52 +02:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub }:
|
2020-08-13 20:45:40 +02:00
|
|
|
|
2021-10-17 13:31:01 +02:00
|
|
|
let
|
2021-11-03 13:43:23 +01:00
|
|
|
srcInfo = lib.importJSON ./src.json;
|
2021-10-17 13:31:01 +02:00
|
|
|
in
|
|
|
|
|
2020-08-13 20:45:40 +02:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "chroma";
|
2021-10-17 13:29:00 +02:00
|
|
|
version = "0.9.4";
|
2020-08-13 20:45:40 +02:00
|
|
|
|
2021-10-17 13:31:01 +02:00
|
|
|
# To update:
|
|
|
|
# nix-prefetch-git --rev v${version} https://github.com/alecthomas/chroma.git > src.json
|
2020-08-13 20:45:40 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "alecthomas";
|
2020-11-21 15:17:44 +01:00
|
|
|
repo = pname;
|
2020-08-13 20:45:40 +02:00
|
|
|
rev = "v${version}";
|
2021-10-17 13:31:01 +02:00
|
|
|
inherit (srcInfo) sha256;
|
2021-06-27 11:46:52 +02:00
|
|
|
};
|
2020-11-21 15:17:44 +01:00
|
|
|
|
2021-10-17 13:29:00 +02:00
|
|
|
vendorSha256 = "1l5ryhwifhff41r4z1d2lifpvjcc4yi1vzrzlvkx3iy9dmxqcssl";
|
|
|
|
|
|
|
|
modRoot = "./cmd/chroma";
|
2020-08-13 20:45:40 +02:00
|
|
|
|
2021-10-17 13:31:01 +02: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 20:45:40 +02: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 ];
|
|
|
|
};
|
|
|
|
}
|