Commit 190ea7b0 authored by chayleaf's avatar chayleaf
Browse files

keepassxc: add firefox native messaging host file

When using a Firefox fork, upstream package relies on you entering the
browser user config path manually and writes the native messaging host
file to that path. It should be much more convenient to manage it in
Nix.
parent 58d98b07
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -97,6 +97,12 @@ stdenv.mkDerivation rec {
    wrapQtApp "$out/Applications/KeePassXC.app/Contents/MacOS/KeePassXC"
  '';

  # See https://github.com/keepassxreboot/keepassxc/blob/cd7a53abbbb81e468efb33eb56eefc12739969b8/src/browser/NativeMessageInstaller.cpp#L317
  postInstall = lib.optionalString withKeePassBrowser ''
    mkdir -p "$out/lib/mozilla/native-messaging-hosts"
    substituteAll "${./firefox-native-messaging-host.json}" "$out/lib/mozilla/native-messaging-hosts/org.keepassxc.keepassxc_browser.json"
  '';

  buildInputs = [
    curl
    botan2
+9 −0
Original line number Diff line number Diff line
{
    "name": "org.keepassxc.keepassxc_browser",
    "description": "KeePassXC integration with native messaging support",
    "path": "@out@/bin/keepassxc-proxy",
    "type": "stdio",
    "allowed_extensions": [
        "keepassxc-browser@keepassxc.org"
    ]
}
+2 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
, browserpass, gnome-browser-connector, uget-integrator, plasma5Packages, bukubrow, pipewire
, tridactyl-native
, fx-cast-bridge
, keepassxc
, udev
, libkrb5
, libva
@@ -70,6 +71,7 @@ let
          ++ lib.optional (cfg.enableUgetIntegrator or false) uget-integrator
          ++ lib.optional (cfg.enablePlasmaBrowserIntegration or false) plasma5Packages.plasma-browser-integration
          ++ lib.optional (cfg.enableFXCastBridge or false) fx-cast-bridge
          ++ lib.optional (cfg.enableKeePassXC or false) keepassxc
          ++ extraNativeMessagingHosts
        ;
      libs =   lib.optionals stdenv.isLinux [ udev libva mesa libnotify xorg.libXScrnSaver cups pciutils ]