Files

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

48 lines
1.3 KiB
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
stdenv,
lib,
fetchFromGitHub,
rustPlatform,
installShellFiles,
versionCheckHook,
nix-update-script,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "openstack-rs";
version = "0.13.1";
src = fetchFromGitHub {
owner = "gtema";
repo = "openstack";
tag = "v${finalAttrs.version}";
hash = "sha256-wK4CDG0W8cI+64wbK4PMvDy50b0WAktmJo+7Wf1ucjQ=";
};
cargoHash = "sha256-q1Q4GBWmdjIpjyN2wH9baxtgwvF6gG0aaqqVDn1ji44=";
nativeBuildInputs = [
installShellFiles
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd osc \
--bash <($out/bin/osc completion bash) \
--fish <($out/bin/osc completion fish) \
--zsh <($out/bin/osc completion zsh)
'';
doInstallCheck = true;
versionCheckProgram = "${placeholder "out"}/bin/${finalAttrs.meta.mainProgram}";
nativeInstallCheckInputs = [ versionCheckHook ];
passthru.updateScript = nix-update-script { };
meta = {
description = "OpenStack CLI and TUI implemented in Rust";
homepage = "https://github.com/gtema/openstack";
changelog = "https://github.com/gtema/openstack/releases/tag/v${finalAttrs.version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ lykos153 ];
mainProgram = "osc";
};
})