blob: 6bef3743d495a395cbe1bd51795e96d17151feaf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
{
lib,
config,
pkgs,
...
}:
let
# Extension ID computed from the pinned extensionKey
patchedHost =
pkgs.runCommand "com.github.browserpass.native.json"
{
nativeBuildInputs = [ pkgs.jq ];
}
''
jq '.allowed_origins = ["chrome-extension://${config.web.chromium.extensions.browserpass.id}/"]' \
${config.programs.browserpass.package}/lib/browserpass/hosts/chromium/com.github.browserpass.native.json \
> $out
'';
in
{
config = lib.mkIf (config.web.chromium.enable && config.security.gopass.enable) {
programs.browserpass = {
enable = true;
browsers = [ "chromium" ];
};
home.file.".config/chromium/NativeMessagingHosts/com.github.browserpass.native.json" = lib.mkForce {
source = patchedHost;
};
};
}
|