go-toml: add build flags

This commit is contained in:
isabel
2024-04-29 22:17:51 +01:00
parent 5467a90a5d
commit 5a69b0b3c4
+14 -6
View File
@@ -3,13 +3,16 @@
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "go-toml";
let
version = "2.2.1";
in
buildGoModule {
pname = "go-toml";
inherit version;
src = fetchFromGitHub {
owner = "pelletier";
repo = pname;
repo = "go-toml";
rev = "v${version}";
sha256 = "sha256-DAtp9ovl6cny0rom80aK+bGe9U/p6zmTQo1Z3MscCjg=";
};
@@ -22,16 +25,21 @@ buildGoModule rec {
"cmd/tomltestgen"
];
# allowGoReference adds the flag `-trimpath` which is also denoted by, go-toml's goreleaser config
# <https://github.com/pelletier/go-toml/blob/a3d5a0bb530b5206c728eed9cb57323061922bcb/.goreleaser.yaml#L13>
allowGoReference = true;
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
];
meta = with lib; {
meta = {
description = "Go library for the TOML language";
homepage = "https://github.com/pelletier/go-toml";
changelog = "https://github.com/pelletier/go-toml/releases/tag/v${version}";
maintainers = [ maintainers.isabelroses ];
license = licenses.mit;
maintainers = [ lib.maintainers.isabelroses ];
license = lib.licenses.mit;
};
}