depot/pkgs/by-name/si/sidekick/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

54 lines
1.3 KiB
Nix

{
lib,
stdenv,
installShellFiles,
buildGoModule,
fetchFromGitHub,
versionCheckHook,
}:
buildGoModule rec {
pname = "sidekick";
version = "0.6.6";
src = fetchFromGitHub {
owner = "MightyMoud";
repo = "sidekick";
rev = "v${version}";
hash = "sha256-Y/dQRix/cxV3NGqTGtRP6Bcprj0jzzOpudgm9a1UMLc=";
};
nativeBuildInputs = [ installShellFiles ];
doInstallCheck = true;
doCheck = true;
vendorHash = "sha256-35MThhVqCcIFH2oQNw6n73JqNVr2T6mXaIJMK9LiXq8=";
ldflags = [
"-s"
"-w"
"-X github.com/mightymoud/sidekick/cmd.version=${version}"
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd sidekick \
--bash <($out/bin/sidekick completion bash) \
--fish <($out/bin/sidekick completion fish) \
--zsh <($out/bin/sidekick completion zsh)
'';
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgramArg = "--version";
meta = {
description = "Command-line tool designed to simplify the process of deploying and managing applications on a VPS";
mainProgram = "sidekick";
homepage = "https://github.com/MightyMoud/sidekick";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ nipeharefa ];
};
}