Files
nixpkgs/pkgs/by-name/tb/tbls/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

64 lines
1.4 KiB
Nix

{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
testers,
tbls,
}:
buildGoModule rec {
pname = "tbls";
version = "1.89.0";
src = fetchFromGitHub {
owner = "k1LoW";
repo = "tbls";
tag = "v${version}";
hash = "sha256-zgn1/GEfF4K23JqoI6OjqzmvutnAVhmmt0sEp+1b2DE=";
};
vendorHash = "sha256-hupOff2cJ+UrJFgMyDu3XYvEjyE/XvvyqiQq408wJsw=";
excludedPackages = [ "scripts/jsonschema" ];
nativeBuildInputs = [ installShellFiles ];
ldflags = [
"-s"
"-w"
];
CGO_CFLAGS = [ "-Wno-format-security" ];
preCheck = ''
# Remove tests that require additional services.
rm -f \
datasource/*_test.go \
drivers/*/*_test.go
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd tbls \
--bash <($out/bin/tbls completion bash) \
--fish <($out/bin/tbls completion fish) \
--zsh <($out/bin/tbls completion zsh)
'';
passthru.tests.version = testers.testVersion {
package = tbls;
command = "tbls version";
inherit version;
};
meta = {
description = "Tool to generate documentation based on a database structure";
homepage = "https://github.com/k1LoW/tbls";
changelog = "https://github.com/k1LoW/tbls/blob/${src.rev}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ azahi ];
mainProgram = "tbls";
};
}