depot/pkgs/by-name/go/go-blueprint/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

48 lines
1.2 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
versionCheckHook,
stdenv,
}:
buildGoModule rec {
pname = "go-blueprint";
version = "0.8.2";
src = fetchFromGitHub {
owner = "Melkeydev";
repo = "go-blueprint";
rev = "v${version}";
hash = "sha256-4KEshM6y27CD+PiyYoz4IWKkfLWRXOTA7bMFfxVYfaI=";
};
ldflags = [
"-s -w -X github.com/melkeydev/go-blueprint/cmd.GoBlueprintVersion=v${version}"
];
vendorHash = "sha256-WBzToupC1/O70OYHbKk7S73OEe7XRLAAbY5NoLL7xvw=";
nativeBuildInputs = [ installShellFiles ];
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
versionCheckProgramArg = "version";
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd go-blueprint \
--bash <($out/bin/go-blueprint completion bash) \
--fish <($out/bin/go-blueprint completion fish) \
--zsh <($out/bin/go-blueprint completion zsh)
'';
meta = {
description = "Initialize Go projects using popular frameworks";
homepage = "https://github.com/Melkeydev/go-blueprint";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ tobifroe ];
mainProgram = "go-blueprint";
};
}