mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-12 08:43:06 +00:00
38 lines
914 B
Nix
38 lines
914 B
Nix
{ lib, buildGoModule, fetchFromGitHub }:
|
|
|
|
let
|
|
srcInfo = lib.importJSON ./src.json;
|
|
in
|
|
|
|
buildGoModule rec {
|
|
pname = "chroma";
|
|
version = "2.4.0";
|
|
|
|
# To update:
|
|
# nix-prefetch-git --rev v${version} https://github.com/alecthomas/chroma.git > src.json
|
|
src = fetchFromGitHub {
|
|
owner = "alecthomas";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
inherit (srcInfo) sha256;
|
|
};
|
|
|
|
vendorSha256 = "02malb9qilixhdjrdd8bf0yml1c2rkvfvdmr25b4xdv0vwvgb9gg";
|
|
|
|
modRoot = "./cmd/chroma";
|
|
|
|
# substitute version info as done in goreleaser builds
|
|
ldflags = [
|
|
"-X" "main.version=${version}"
|
|
"-X" "main.commit=${srcInfo.rev}"
|
|
"-X" "main.date=${srcInfo.date}"
|
|
];
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/alecthomas/chroma";
|
|
description = "A general purpose syntax highlighter in pure Go";
|
|
license = licenses.mit;
|
|
maintainers = [ maintainers.sternenseemann ];
|
|
};
|
|
}
|