Files
nixpkgs/pkgs/by-name/bw/bws/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

73 lines
1.5 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
installShellFiles,
pkg-config,
oniguruma,
openssl,
stdenv,
python3,
perl,
}:
rustPlatform.buildRustPackage rec {
pname = "bws";
version = "1.0.0";
src = fetchFromGitHub {
owner = "bitwarden";
repo = "sdk";
rev = "bws-v${version}";
hash = "sha256-acS4yKppvIBiwBMoa5Ero4G9mUf8OLG/TbrZOolAwuc=";
};
cargoHash = "sha256-SJn00C7vkNoghdVPUszep40RSL8fD+/ELUeuf9GBD7c=";
nativeBuildInputs = [
installShellFiles
pkg-config
]
++ lib.optionals stdenv.hostPlatform.isLinux [
perl
];
buildInputs = [
oniguruma
]
++ lib.optionals stdenv.hostPlatform.isLinux [
openssl
];
env = {
PYO3_PYTHON = "${python3}/bin/python3";
RUSTONIG_SYSTEM_LIBONIG = true;
};
cargoBuildFlags = [
"--package"
"bws"
];
cargoTestFlags = [
"--package"
"bws"
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd bws \
--bash <($out/bin/bws completions bash) \
--fish <($out/bin/bws completions fish) \
--zsh <($out/bin/bws completions zsh)
'';
meta = {
changelog = "https://github.com/bitwarden/sdk/blob/${src.rev}/crates/bws/CHANGELOG.md";
description = "Bitwarden Secrets Manager CLI";
homepage = "https://bitwarden.com/help/secrets-manager-cli/";
license = lib.licenses.unfree; # BITWARDEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT
mainProgram = "bws";
maintainers = with lib.maintainers; [ dit7ya ];
};
}