3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/text/chroma/default.nix

38 lines
915 B
Nix
Raw Normal View History

{ lib, buildGoModule, fetchFromGitHub }:
2020-08-13 19:45:40 +01:00
let
srcInfo = lib.importJSON ./src.json;
in
2020-08-13 19:45:40 +01:00
buildGoModule rec {
pname = "chroma";
2022-01-27 14:09:28 +00:00
version = "0.10.0";
2020-08-13 19:45:40 +01:00
# To update:
# nix-prefetch-git --rev v${version} https://github.com/alecthomas/chroma.git > src.json
2020-08-13 19:45:40 +01:00
src = fetchFromGitHub {
owner = "alecthomas";
repo = pname;
2020-08-13 19:45:40 +01:00
rev = "v${version}";
inherit (srcInfo) sha256;
};
2022-01-27 14:09:28 +00:00
vendorSha256 = "09b718vjd6npg850fr7z6srs2sc5vsr7byzlz5yb5qx0vm3ajxpf";
modRoot = "./cmd/chroma";
2020-08-13 19:45:40 +01: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 19:45:40 +01: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 ];
};
}