diff options
Diffstat (limited to 'pkgs/development/tools/go-toml/default.nix')
-rw-r--r-- | pkgs/development/tools/go-toml/default.nix | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/pkgs/development/tools/go-toml/default.nix b/pkgs/development/tools/go-toml/default.nix index 2fcb524b5930c..5f5ad595cabf7 100644 --- a/pkgs/development/tools/go-toml/default.nix +++ b/pkgs/development/tools/go-toml/default.nix @@ -1,12 +1,18 @@ -{ lib, buildGoModule, fetchFromGitHub }: - -buildGoModule rec { - pname = "go-toml"; +{ + lib, + buildGoModule, + fetchFromGitHub, +}: +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="; }; @@ -19,13 +25,21 @@ buildGoModule rec { "cmd/tomltestgen" ]; - ldflags = [ "-s" "-w" ]; + # 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 = [ ]; - license = licenses.mit; + maintainers = [ lib.maintainers.isabelroses ]; + license = lib.licenses.mit; }; } |