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
52 lines
1.1 KiB
Nix
52 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
installShellFiles,
|
|
versionCheckHook,
|
|
}:
|
|
|
|
buildGoModule (finalAttrs: {
|
|
pname = "sqlc";
|
|
version = "1.30.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "sqlc-dev";
|
|
repo = "sqlc";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-ns0FIGu+aOuRFBYHrAqWUiYCwHE5XQqlR3AFKy5lq4E=";
|
|
};
|
|
|
|
proxyVendor = true;
|
|
vendorHash = "sha256-jivqXwuq6wbNQFW8BlBZIKBLpIotA2MMR5iywODycpY=";
|
|
|
|
subPackages = [ "cmd/sqlc" ];
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
];
|
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
installShellCompletion --cmd sqlc \
|
|
--bash <($out/bin/sqlc completion bash) \
|
|
--fish <($out/bin/sqlc completion fish) \
|
|
--zsh <($out/bin/sqlc completion zsh)
|
|
'';
|
|
|
|
doInstallCheck = true;
|
|
nativeInstallCheckInputs = [ versionCheckHook ];
|
|
versionCheckProgramArg = "version";
|
|
|
|
meta = {
|
|
description = "Generate type-safe code from SQL";
|
|
homepage = "https://sqlc.dev/";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ aaronjheng ];
|
|
mainProgram = "sqlc";
|
|
};
|
|
})
|