2020-04-24 23:36:52 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
options.programs.browserpass.enable = lib.mkEnableOption "Browserpass native messaging host";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
config = lib.mkIf config.programs.browserpass.enable {
|
2020-04-24 23:36:52 +00:00
|
|
|
environment.etc = let
|
|
|
|
appId = "com.github.browserpass.native.json";
|
|
|
|
source = part: "${pkgs.browserpass}/lib/browserpass/${part}/${appId}";
|
|
|
|
in {
|
|
|
|
# chromium
|
|
|
|
"chromium/native-messaging-hosts/${appId}".source = source "hosts/chromium";
|
|
|
|
"chromium/policies/managed/${appId}".source = source "policies/chromium";
|
|
|
|
|
|
|
|
# chrome
|
|
|
|
"opt/chrome/native-messaging-hosts/${appId}".source = source "hosts/chromium";
|
|
|
|
"opt/chrome/policies/managed/${appId}".source = source "policies/chromium";
|
|
|
|
|
|
|
|
# vivaldi
|
|
|
|
"opt/vivaldi/native-messaging-hosts/${appId}".source = source "hosts/chromium";
|
|
|
|
"opt/vivaldi/policies/managed/${appId}".source = source "policies/chromium";
|
|
|
|
|
|
|
|
# brave
|
|
|
|
"opt/brave/native-messaging-hosts/${appId}".source = source "hosts/chromium";
|
|
|
|
"opt/brave/policies/managed/${appId}".source = source "policies/chromium";
|
|
|
|
};
|
2023-11-16 04:20:00 +00:00
|
|
|
programs.firefox.nativeMessagingHosts.packages = [ pkgs.browserpass ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|