2025-08-16 03:13:19 +00:00

42 lines
983 B
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
versionCheckHook,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "tombi";
version = "0.5.6";
src = fetchFromGitHub {
owner = "tombi-toml";
repo = "tombi";
tag = "v${finalAttrs.version}";
hash = "sha256-EjKvVBIiG20qsr4XmGtjx7I39/tvl9HGPza5fpbwMeg=";
};
# Tests relies on the presence of network
doCheck = false;
cargoBuildFlags = [ "--package tombi-cli" ];
cargoHash = "sha256-TlGGkj0YtVp00swQfgjRqmYkKHDBxEUh3e4FYh6vRgk=";
postPatch = ''
substituteInPlace Cargo.toml \
--replace-fail 'version = "0.0.0-dev"' 'version = "${finalAttrs.version}"'
'';
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
meta = {
description = "TOML Formatter / Linter / Language Server";
homepage = "https://github.com/tombi-toml/tombi";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ psibi ];
mainProgram = "tombi";
};
})