patch bitwarden to disable annoying ssh-agent confirmation and clean dead overlays

This commit is contained in:
cy 2025-03-11 14:52:31 -04:00
parent 826146df9d
commit f4f0691647
Signed by: cy
SSH key fingerprint: SHA256:o/geVWV4om1QhUSkKvDQeW/eAihwnjyXkqMwrVdbuts
5 changed files with 44 additions and 75 deletions

View file

@ -0,0 +1,7 @@
final: prev: {
bitwarden-desktop = prev.bitwarden-desktop.overrideAttrs (finalAttrs: prevAttrs: {
patches = prevAttrs.patches ++ [
./ssh-agent-no-confirm.patch
];
});
}

View file

@ -0,0 +1,34 @@
diff --git a/apps/desktop/desktop_native/core/src/ssh_agent/mod.rs b/core/src/ssh_agent/mod.rs
index 4e304cc..8203dca 100644
--- a/apps/desktop/desktop_native/core/src/ssh_agent/mod.rs
+++ b/apps/desktop/desktop_native/core/src/ssh_agent/mod.rs
@@ -44,28 +44,7 @@ impl ssh_agent::Agent<peerinfo::models::PeerInfo> for BitwardenDesktopAgent {
return false;
}
- let request_id = self.get_request_id().await;
- println!(
- "[SSH Agent] Confirming request from application: {}",
- info.process_name()
- );
-
- let mut rx_channel = self.get_ui_response_rx.lock().await.resubscribe();
- self.show_ui_request_tx
- .send(SshAgentUIRequest {
- request_id,
- cipher_id: Some(ssh_key.cipher_uuid.clone()),
- process_name: info.process_name().to_string(),
- is_list: false,
- })
- .await
- .expect("Should send request to ui");
- while let Ok((id, response)) = rx_channel.recv().await {
- if id == request_id {
- return response;
- }
- }
- false
+ true
}
async fn can_list(&self, info: &peerinfo::models::PeerInfo) -> bool {

View file

@ -1,44 +0,0 @@
final: prev:
let
newRust = final.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
newRustPlatform = final.makeRustPlatform {
cargo = newRust;
rustc = newRust;
};
in
{
conduwuit = prev.conduwuit.override (old: {
rustPlatform = newRustPlatform // {
buildRustPackage =
args:
newRustPlatform.buildRustPackage (
args
// {
version = "0.5.0-rc2";
src = final.fetchFromGitHub {
owner = "girlbossceo";
repo = "conduwuit";
rev = "5b8464252c2c03edf65e43153be026dbb768a12a";
hash = "sha256-yNdxoVZX13QUDJYM6zTMY9ExvacTqB+f0MLvDreSW8U=";
};
doCheck = false;
cargoHash = "sha256-g19UujLI9d4aw+1273gfC17LDLOciqBvuLhe/VCsh80=";
# unstable has this set to "conduit"
meta.mainProgram = "conduwuit";
buildFeatures = [
"brotli_compression"
"element_hacks"
"gzip_compression"
"release_max_log_level" # without this feature to enable debug logging
"sentry_telemetry"
"systemd"
"zstd_compression"
"jemalloc"
"io_uring"
];
}
);
};
});
}

View file

@ -1,28 +0,0 @@
# This is the authoritiative configuration of this project's Rust toolchain.
#
# Other files that need upkeep when this changes:
#
# * `Cargo.toml`
# * `flake.nix`
#
# Search in those files for `rust-toolchain.toml` to find the relevant places.
# If you're having trouble making the relevant changes, bug a maintainer.
[toolchain]
channel = "1.84.0"
profile = "minimal"
components = [
# For rust-analyzer
"rust-src",
"rust-analyzer",
# For CI and editors
"rustfmt",
"clippy",
]
targets = [
#"x86_64-apple-darwin",
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-musl",
"aarch64-unknown-linux-musl",
#"aarch64-apple-darwin",
]

View file

@ -3,6 +3,7 @@ let
overlays = [ overlays = [
./attic ./attic
./zipline ./zipline
./bitwarden
]; ];
importedOverlays = map (m: import m) overlays; importedOverlays = map (m: import m) overlays;
in in
@ -12,12 +13,11 @@ importedOverlays
final: prev: final: prev:
let let
nixpkgsFrom = flake: pkg: flake.legacyPackages.${prev.system}.${pkg}; nixpkgsFrom = flake: pkg: flake.legacyPackages.${prev.system}.${pkg};
pkgFrom = flake: pkgFrom' flake "default"; pkgFrom = flake: pkg: flake.packages.${prev.system}.${pkg};
pkgFrom' = flake: pkg: flake.packages.${prev.system}.${pkg};
in in
{ {
conduwuit = conduwuit =
pkgFrom' inputs.conduwuit "static-x86_64-linux-musl-all-features-x86_64-haswell-optimised"; pkgFrom inputs.conduwuit "static-x86_64-linux-musl-all-features-x86_64-haswell-optimised";
pixelflasher = nixpkgsFrom inputs.pixelflasher "pixelflasher"; pixelflasher = nixpkgsFrom inputs.pixelflasher "pixelflasher";
} }
) )