nixpkgs/pkgs/by-name/bw/bws/package.nix

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

74 lines
1.7 KiB
Nix
Raw Permalink Normal View History

2023-08-07 14:06:31 +01:00
{ lib
, rustPlatform
, fetchFromGitHub
2024-04-06 05:20:00 +01:00
, installShellFiles
2023-08-07 14:06:31 +01:00
, pkg-config
, oniguruma
, openssl
, stdenv
, darwin
, python3
2024-01-06 03:19:00 +00:00
, perl
2023-08-07 14:06:31 +01:00
}:
rustPlatform.buildRustPackage rec {
pname = "bws";
2024-09-27 00:51:31 +01:00
version = "1.0.0";
2023-08-07 14:06:31 +01:00
src = fetchFromGitHub {
owner = "bitwarden";
repo = "sdk";
rev = "bws-v${version}";
2024-09-27 00:51:31 +01:00
hash = "sha256-acS4yKppvIBiwBMoa5Ero4G9mUf8OLG/TbrZOolAwuc=";
2023-08-07 14:06:31 +01:00
};
2024-01-06 03:19:00 +00:00
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
2024-09-27 00:51:31 +01:00
"passkey-0.2.0" = "sha256-dCQUu4lWqdQ6EiNLPRVHL1dLVty4r8//ZQzV8XCBhmY=";
2024-01-06 03:19:00 +00:00
};
};
2023-08-07 14:06:31 +01:00
nativeBuildInputs = [
2024-04-06 05:20:00 +01:00
installShellFiles
2023-08-07 14:06:31 +01:00
pkg-config
2024-04-06 05:20:00 +01:00
] ++ lib.optionals stdenv.hostPlatform.isLinux [
perl
2023-08-07 14:06:31 +01:00
];
buildInputs =
[
oniguruma
2024-04-06 05:20:00 +01:00
] ++ lib.optionals stdenv.hostPlatform.isLinux [
2023-08-07 14:06:31 +01:00
openssl
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
2024-04-06 05:20:00 +01:00
darwin.apple_sdk.frameworks.SystemConfiguration
2023-08-07 14:06:31 +01:00
];
env = {
PYO3_PYTHON = "${python3}/bin/python3";
RUSTONIG_SYSTEM_LIBONIG = true;
};
2024-04-06 05:20:00 +01:00
cargoBuildFlags = [ "--package" "bws" ];
cargoTestFlags = [ "--package" "bws" ];
2023-08-07 14:06:31 +01:00
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
2024-04-06 05:20:00 +01:00
installShellCompletion --cmd bws \
--bash <($out/bin/bws completions bash) \
--fish <($out/bin/bws completions fish) \
--zsh <($out/bin/bws completions zsh)
'';
2023-08-07 14:06:31 +01:00
meta = {
2024-04-06 05:20:00 +01:00
changelog = "https://github.com/bitwarden/sdk/blob/${src.rev}/crates/bws/CHANGELOG.md";
2023-08-07 14:06:31 +01:00
description = "Bitwarden Secrets Manager CLI";
2024-04-06 05:20:00 +01:00
homepage = "https://bitwarden.com/help/secrets-manager-cli/";
2023-08-07 14:06:31 +01:00
license = lib.licenses.unfree; # BITWARDEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT
mainProgram = "bws";
maintainers = with lib.maintainers; [ dit7ya ];
};
}