Luke Granger-Brown
57725ef3ec
git-subtree-dir: third_party/nixpkgs git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
30 lines
1.1 KiB
Nix
30 lines
1.1 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
|
|
options.programs.browserpass.enable = lib.mkEnableOption "Browserpass native messaging host";
|
|
|
|
config = lib.mkIf config.programs.browserpass.enable {
|
|
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";
|
|
};
|
|
programs.firefox.nativeMessagingHosts.packages = [ pkgs.browserpass ];
|
|
};
|
|
}
|