nixpkgs/pkgs/by-name/go/go-toml/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

46 lines
1.1 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
}:
let
version = "2.2.3";
in
buildGoModule {
pname = "go-toml";
inherit version;
src = fetchFromGitHub {
owner = "pelletier";
repo = "go-toml";
rev = "v${version}";
sha256 = "sha256-+l89SvJ/4SxVItys1ROLOv2hZ5euU1MF21Yn0siQHUM=";
};
vendorHash = "sha256-YkOcpzn5AKFMDWUYbKY8DzGMiIMSyaDfexFmXv5HNQI=";
excludedPackages = [
"cmd/gotoml-test-decoder"
"cmd/gotoml-test-encoder"
"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 = {
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 = [ lib.maintainers.isabelroses ];
license = lib.licenses.mit;
};
}