blob: a0281ef7c6a2bf3d5cdf0cddaaea904cf9b58903 (
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
{
config,
lib,
...
}:
let
extensions = {
canvasblocker.id = "CanvasBlocker@kkapsner.de";
# default settings look fine
url-in-title-keepass.id = "{45cf9154-a39d-4c84-93e7-840362a3d8d0}";
# no settings
clearurls.id = "{74145f27-f039-47ce-a470-a662b129930a}";
# default settings are fine and
# contain data that should be updated automatically
temporary-containers = {
id = "{c607c8df-14a7-4f28-894f-29e8722976af}";
# exported settings
settings = lib.fromJSON (builtins.readFile ./temporary-containers.json);
};
floccus.id = "floccus@handmadeideas.org";
darkreader.id = "addon@darkreader.org";
# no settings stored in browser-extension-data/
ublock-origin = {
id = "uBlock0@raymondhill.net";
settings = lib.fromJSON (builtins.readFile ./ublock-origin.json);
};
firefox-color = {
id = "FirefoxColor@mozilla.com";
settings.theme.colors =
let
mkBgColor = lib.mkForce (
with config.lib.stylix.colors;
{
r = base00-rgb-r;
g = base00-rgb-g;
b = base00-rgb-b;
}
);
in
{
frame = mkBgColor;
sidebar_border = mkBgColor;
popup_border = mkBgColor;
tab_baground_separator = mkBgColor;
tab_line = mkBgColor;
toolbar_field_border_focus = mkBgColor;
};
};
}
// (lib.optionalAttrs config.personal.identities.work {
zotero =
let
version = "5.0.217";
in
{
id = "zotero@chnm.gmu.edu";
install_url = "https://www.zotero.org/download/connector/dl?browser=firefox&version=${version}";
};
});
in
{
programs.firefox = {
policies.ExtensionSettings = {
"*".installation_mode = "blocked";
}
// lib.mapAttrs' (
name:
{
id,
install_url ? "https://addons.mozilla.org/firefox/downloads/latest/${name}/latest.xpi",
...
}:
{
name = id;
value = {
inherit install_url;
installation_mode = "force_installed";
updates_disabled = true;
};
}
) extensions;
profiles.default.extensions.settings = lib.mapAttrs' (
_:
{
id,
settings ? { },
...
}:
{
name = id;
value =
if settings != { } then
{
force = true;
inherit settings;
}
else
{
force = false;
};
}
) extensions;
};
}
|