Unverified Commit 5a69b0b3 authored by isabel's avatar isabel
Browse files

go-toml: add build flags

parent 5467a90a
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -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;
  };
}