diff options
author | chayleaf <chayleaf-git@pavluk.org> | 2023-10-13 04:24:16 +0700 |
---|---|---|
committer | chayleaf <chayleaf-git@pavluk.org> | 2023-10-13 05:43:46 +0700 |
commit | 190ea7b09e4f24af8b8105cdf3a8e67d5b6828c0 (patch) | |
tree | a8f88e778f22341a6915cbec84be80209f3b2355 /pkgs | |
parent | 58d98b0742b7818bf3f31179e10707f220a993a2 (diff) | |
download | nixpkgs-190ea7b09e4f24af8b8105cdf3a8e67d5b6828c0.tar nixpkgs-190ea7b09e4f24af8b8105cdf3a8e67d5b6828c0.tar.gz nixpkgs-190ea7b09e4f24af8b8105cdf3a8e67d5b6828c0.tar.bz2 nixpkgs-190ea7b09e4f24af8b8105cdf3a8e67d5b6828c0.tar.lz nixpkgs-190ea7b09e4f24af8b8105cdf3a8e67d5b6828c0.tar.xz nixpkgs-190ea7b09e4f24af8b8105cdf3a8e67d5b6828c0.tar.zst nixpkgs-190ea7b09e4f24af8b8105cdf3a8e67d5b6828c0.zip |
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.
Diffstat (limited to 'pkgs')
3 files changed, 17 insertions, 0 deletions
diff --git a/pkgs/applications/misc/keepassxc/default.nix b/pkgs/applications/misc/keepassxc/default.nix index 762434ef12c..49406fc0114 100644 --- a/pkgs/applications/misc/keepassxc/default.nix +++ b/pkgs/applications/misc/keepassxc/default.nix @@ -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 diff --git a/pkgs/applications/misc/keepassxc/firefox-native-messaging-host.json b/pkgs/applications/misc/keepassxc/firefox-native-messaging-host.json new file mode 100644 index 00000000000..70f1b26041f --- /dev/null +++ b/pkgs/applications/misc/keepassxc/firefox-native-messaging-host.json @@ -0,0 +1,9 @@ +{ + "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" + ] +} diff --git a/pkgs/applications/networking/browsers/firefox/wrapper.nix b/pkgs/applications/networking/browsers/firefox/wrapper.nix index 6561e51d7d9..28e97bcaa41 100644 --- a/pkgs/applications/networking/browsers/firefox/wrapper.nix +++ b/pkgs/applications/networking/browsers/firefox/wrapper.nix @@ -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 ] |