blob: e6f5aad590808efc034cf4dffe12faa4e90a6d48 (
plain) (
blame)
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
|
{ config, pkgs, lib, ... }:
let
unwrapped-firefox-package = pkgs.firefox-devedition-unwrapped;
homepage-url = "file://${config.xdg.configHome}/qutebrowser/homepage/index.html";
extensions = [
"https://addons.mozilla.org/firefox/downloads/file/3792127/firefox_dracula-1.0.xpi"
"https://addons.mozilla.org/firefox/downloads/file/4261352/tridactyl_vim-1.24.1.xpi"
# dev
"https://addons.mozilla.org/firefox/downloads/file/4218479/font_inspect-0.5.8.xpi"
"https://addons.mozilla.org/firefox/downloads/file/4314064/react_devtools-5.3.1.xpi"
# others
"https://addons.mozilla.org/firefox/downloads/file/4332776/languagetool-8.11.6.xpi"
"https://addons.mozilla.org/firefox/downloads/file/4317971/darkreader-4.9.88.xpi"
"https://addons.mozilla.org/firefox/downloads/file/3970625/screen_recorder-0.1.8.xpi"
];
# about:config
preferences = {
"browser.newtabpage.enabled" = false;
"browser.startup.homepage" = homepage-url;
"browser.newtab.url" = homepage-url;
"browser.startup.blankWindow" = false;
"browser.tabs.drawInTitlebar" = true;
"browser.uidensity" = 0;
"browser.theme.dark-private-windows" = true;
"browser.theme.toolbar-theme" = 0;
"browser.aboutConfig.showWarning" = false;
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
# "devtools.theme" = "dark";
"ui.systemUsesDarkTheme" = 2;
# "devtools.toolbox.alwaysOnTop" = true;
# "devtools.toolbox.host" = "window";
"layers.acceleration.force-enabled" = true;
"gfx.webrender.all" = true;
# "svg.context-properties.content.enabled" = true;
"widget.gtk.rounded-bottom-corners.enabled" = true;
"browser.urlbar.suggest.calculator" = true;
"browser.urlbar.unitConversion.enabled" = true;
"extensions.pocket.enabled" = false;
"extensions.pocket.showHome" = false;
"browser.urlbar.suggest.pocket" = false;
# "privacy.donottrackheader.enabled" = true;
"privacy.globalprivacycontrol.enabled" = true;
"browser.search.suggest.enabled" = false;
"browser.urlbar.suggest.searches" = false;
"browser.urlbar.suggest.recentsearches" = false;
"browser.sessionstore.restore_tabs_lazily" = false;
"browser.dataFeatureRecommendations.enabled" = false;
"extensions.htmlaboutaddons.recommendations.enabled" = false;
"layout.css.has-selector.enabled" = true;
"browser.toolbars.bookmarks.visibility" = "never";
# "identity.fxaccounts.toolbar.enabled" = false;
"browser.tabs.insertAfterCurrent" = true;
"browser.urlbar.shortcuts.bookmarks" = false;
"browser.urlbar.suggest.bookmark" = false;
"browser.newtab.privateAllowed" = true;
"browser.download.forbid_open_with" = true;
"browser.download.autohideButton" = true;
"browser.download.useDownloadDir" = false;
# HAcky stuff
# "general.config.sandbox_enabled" = false;
# "general.config.obscure_value" = false;
"xpinstall.signatures.required" = false;
"extensions.install_origins.enabled" = false;
};
# https://mozilla.github.io/policy-templates
policies = {
ManagedBookmarks = [
{ toplevel_name = "Managed bookmarks"; }
{ name = "Daily Dev"; url = "https://app.daily.dev"; }
{ name = "Email: Microsoft Outlook"; url = "https://outlook.office365.com/mail/"; }
{ name = "Email: GMail"; url = "https://mail.google.com/mail/u/0/"; }
# { name = "Shtuff"; children = [] }
];
DisplayBookmarksToolbar = "never";
NoDefaultBookmarks = true;
DisableAppUpdate = true;
DisableSystemAddonUpdate = true;
DisableProfileImport = true;
DisableFirefoxStudies = true;
DisableTelemetry = true;
DisableFeedbackCommands = true;
DisablePocket = true;
DisableAccounts = true;
DontCheckDefaultBrowser = true;
OfferToSaveLogins = false;
PasswordManagerEnabled = false;
DefaultDownloadDirectory = "${config.home.homeDirectory}/Downloads/firefox";
NewTabPage = false;
Homepage = { URL = homepage-url; StartPage = "previous-session"; };
OverrideFirstRunPage = "";
# PopupBlocking = [];
SearchEngines = {
Default = "DuckDuckGo";
SearchSuggestEnabled = false;
Remove = [ "Google" "Bing" "Amazon.com" "eBay" "Wikipedia" ];
PreventInstalls = false;
Add = [
{
Name = "DuckDuckGo";
URLTemplate = "https://duckduckgo.com/?q={searchTerms}";
Alias = "ddg";
}
{
Name = "Google";
URLTemplate = "https://google.com/?q={searchTerms}";
Alias = "google";
}
];
};
UserMessaging = {
ExtensionRecommendations = false;
SkipOnboarding = true;
};
ShowHomeButton = false;
# Permissions = {
# Camera = {
# Allow = [ "https://meet.google.com" ];
# Block = [];
# };
# };
Extensions = {
Install = extensions;
Uninstall = [
"google@search.mozilla.org"
"bing@search.mozilla.org"
"amazondotcom@search.mozilla.org"
"ebay@search.mozilla.org"
"wikipedia@search.mozilla.org"
];
};
ExtensionSettings = {
"google@search.mozilla.org".installation_mode = "blocked";
"bing@search.mozilla.org".installation_mode = "blocked";
"amazondotcom@search.mozilla.org".installation_mode = "blocked";
"ebay@search.mozilla.org".installation_mode = "blocked";
"wikipedia@search.mozilla.org".installation_mode = "blocked";
};
Preferences = lib.mapAttrs (_key: val: { Status = "locked"; Value = val; }) preferences;
};
firefox = pkgs.wrapFirefox unwrapped-firefox-package {
extraPrefs = builtins.readFile ./autoconfig.js;
};
profilePath = "default";
in {
programs.firefox = {
enable = true;
package = firefox;
nativeMessagingHosts = [ pkgs.tridactyl-native ];
policies = policies;
};
home.file = {
".config/tridactyl".source = ./tridactyl;
".mozilla/firefox/${profilePath}/chrome".source = ./chrome;
".mozilla/firefox/profiles.ini".text = lib.generators.toINI {} {
Profile1 = {
Name = "default";
IsRelative = 1;
Path = profilePath;
};
Profile0 = {
Name = "dev-edition-default";
Default = 1;
IsRelative = 1;
Path = profilePath;
};
General = {
StartWithLastProfile = 1;
Version = 2;
};
};
};
}
|