rime-ls: init at 0.4.0 (#351508)
[NixPkgs.git] / nixos / modules / programs / browserpass.nix
blobab6be266ea8d6b077acc3f55c1368b2496f5d13b
1 { config, lib, pkgs, ... }:
5   options.programs.browserpass.enable = lib.mkEnableOption "Browserpass native messaging host";
7   config = lib.mkIf config.programs.browserpass.enable {
8     environment.etc = let
9       appId = "com.github.browserpass.native.json";
10       source = part: "${pkgs.browserpass}/lib/browserpass/${part}/${appId}";
11     in {
12       # chromium
13       "chromium/native-messaging-hosts/${appId}".source = source "hosts/chromium";
14       "chromium/policies/managed/${appId}".source = source "policies/chromium";
16       # chrome
17       "opt/chrome/native-messaging-hosts/${appId}".source = source "hosts/chromium";
18       "opt/chrome/policies/managed/${appId}".source = source "policies/chromium";
20       # vivaldi
21       "opt/vivaldi/native-messaging-hosts/${appId}".source = source "hosts/chromium";
22       "opt/vivaldi/policies/managed/${appId}".source = source "policies/chromium";
24       # brave
25       "opt/brave/native-messaging-hosts/${appId}".source = source "hosts/chromium";
26       "opt/brave/policies/managed/${appId}".source = source "policies/chromium";
27     };
28     programs.firefox.nativeMessagingHosts.packages = [ pkgs.browserpass ];
29   };