bitwarden-cli: build from source

This commit is contained in:
Robert Schütz 2023-02-28 19:10:57 -08:00
parent 0a5266e136
commit 2995a890b5
5 changed files with 48 additions and 18 deletions

View File

@ -16,7 +16,6 @@
"@antora/cli" = "antora";
"@astrojs/language-server" = "astro-ls";
"@babel/cli" = "babel";
"@bitwarden/cli" = "bw";
"@commitlint/cli" = "commitlint";
"@forge/cli" = "forge";
"@gitbeaker/cli" = "gitbeaker";

View File

@ -3,7 +3,6 @@
, "@antfu/ni"
, "@astrojs/language-server"
, "@babel/cli"
, "@bitwarden/cli"
, "@commitlint/cli"
, "@commitlint/config-conventional"
, "@emacs-eask/cli"

View File

@ -93,21 +93,6 @@ final: prev: {
'';
};
bitwarden-cli = prev."@bitwarden/cli".override {
name = "bitwarden-cli";
nativeBuildInputs = with pkgs; [
pkg-config
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.CoreText
];
buildInputs = with pkgs; [
pixman
cairo
pango
giflib
];
};
bower2nix = prev.bower2nix.override {
nativeBuildInputs = [ pkgs.buildPackages.makeWrapper ];
postInstall = ''

View File

@ -0,0 +1,47 @@
{ lib
, stdenv
, buildNpmPackage
, nodejs_18
, fetchFromGitHub
, python3
, darwin
}:
let
buildNpmPackage' = buildNpmPackage.override { nodejs = nodejs_18; };
in buildNpmPackage' rec {
pname = "bitwarden-cli";
version = "2023.5.0";
src = fetchFromGitHub {
owner = "bitwarden";
repo = "clients";
rev = "cli-v${version}";
hash = "sha256-ELKpGSY4ZbgSk4vJnTiB+IOa8RQU8Ahy3A1mYsKtthU=";
};
npmDepsHash = "sha256-G8DEYPjEP3L4s0pr5n2ZTj8kkT0E7Po1BKhZ2hUdJuY=";
nativeBuildInputs = [
python3
] ++ lib.optionals stdenv.isDarwin [
darwin.cctools
];
makeCacheWritable = true;
env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
npmBuildScript = "build:prod";
npmWorkspace = "apps/cli";
meta = with lib; {
changelog = "https://github.com/bitwarden/clients/releases/tag/${src.rev}";
description = "A secure and free password manager for all of your devices";
homepage = "https://bitwarden.com";
license = lib.licenses.gpl3Only;
mainProgram = "bw";
maintainers = with maintainers; [ dotlambda ];
};
}

View File

@ -3356,7 +3356,7 @@ with pkgs;
bitwarden = callPackage ../tools/security/bitwarden { };
inherit (nodePackages) bitwarden-cli;
bitwarden-cli = callPackage ../tools/security/bitwarden/cli.nix { };
bitwarden-menu = python3Packages.callPackage ../applications/misc/bitwarden-menu { };