Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

86 lines
2.1 KiB
Nix
Raw Permalink Normal View History

2025-06-18 22:56:16 +02:00
{
stdenv,
lib,
buildGoModule,
buildPackages,
fetchFromGitHub,
installShellFiles,
nix-update-script,
versionCheckHook,
writableTmpDirAsHomeHook,
}:
buildGoModule (finalAttrs: {
pname = "foxglove-cli";
2025-08-09 21:40:14 +00:00
version = "1.0.25";
2025-06-18 22:56:16 +02:00
src = fetchFromGitHub {
owner = "foxglove";
repo = "foxglove-cli";
tag = "v${finalAttrs.version}";
2025-08-09 21:40:14 +00:00
hash = "sha256-zmX3eCh5NYCbYlbx6bIxwF6Qktj+kwV4KpVsTI9ofZ8=";
2025-06-18 22:56:16 +02:00
};
2025-07-31 15:56:51 +00:00
vendorHash = "sha256-fL/eOGx81pdIPWHt14cf4VoIqmfUmbkKa8/y0QQKYko=";
2025-06-18 22:56:16 +02:00
env.CGO_ENABLED = 0;
tags = [ "netgo" ];
ldflags = [
"-s"
"-w"
"-X main.Version=${finalAttrs.version}"
];
nativeBuildInputs = [
installShellFiles
];
modRoot = "foxglove";
checkFlags =
let
skippedTests = [
"TestDoExport"
"TestExport"
"TestExportCommand"
"TestImport"
"TestImportCommand"
"TestLogin"
"TestLoginCommand"
];
in
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) (
let
emulator = stdenv.hostPlatform.emulator buildPackages;
in
''
installShellCompletion --cmd foxglove \
--bash <(${emulator} $out/bin/foxglove completion bash) \
--fish <(${emulator} $out/bin/foxglove completion fish) \
--zsh <(${emulator} $out/bin/foxglove completion zsh)
''
);
passthru.updateScript = nix-update-script { };
doInstallCheck = true;
nativeInstallCheckInputs = [
versionCheckHook
writableTmpDirAsHomeHook
];
versionCheckProgram = "${placeholder "out"}/bin/${finalAttrs.meta.mainProgram}";
versionCheckProgramArg = "version";
versionCheckKeepEnvironment = [ "HOME" ];
meta = {
changelog = "https://github.com/foxglove/foxglove-cli/releases/tag/v${finalAttrs.version}";
description = "Interact with the Foxglove platform";
downloadPage = "https://github.com/foxglove/foxglove-cli";
homepage = "https://docs.foxglove.dev/docs/cli";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ sascha8a ];
mainProgram = "foxglove";
};
})