typioca: 2.7.0 -> 2.8.0
[NixPkgs.git] / nixos / modules / programs / browserpass.nix
bloba9670a37e618c6fd30363bd82d1215c91acb4038
1 { config, lib, pkgs, ... }:
3 with lib;
7   options.programs.browserpass.enable = mkEnableOption (lib.mdDoc "Browserpass native messaging host");
9   config = mkIf config.programs.browserpass.enable {
10     environment.etc = let
11       appId = "com.github.browserpass.native.json";
12       source = part: "${pkgs.browserpass}/lib/browserpass/${part}/${appId}";
13     in {
14       # chromium
15       "chromium/native-messaging-hosts/${appId}".source = source "hosts/chromium";
16       "chromium/policies/managed/${appId}".source = source "policies/chromium";
18       # chrome
19       "opt/chrome/native-messaging-hosts/${appId}".source = source "hosts/chromium";
20       "opt/chrome/policies/managed/${appId}".source = source "policies/chromium";
22       # vivaldi
23       "opt/vivaldi/native-messaging-hosts/${appId}".source = source "hosts/chromium";
24       "opt/vivaldi/policies/managed/${appId}".source = source "policies/chromium";
26       # brave
27       "opt/brave/native-messaging-hosts/${appId}".source = source "hosts/chromium";
28       "opt/brave/policies/managed/${appId}".source = source "policies/chromium";
29     };
30     programs.firefox.nativeMessagingHosts.packages = [ pkgs.browserpass ];
31   };