Personal-use NixOS configuration
1{ pkgs-firefox-addons, ... }:
2
3let
4 nixosIcon = "https://wiki.nixos.org/favicon.ico";
5in
6{
7 imports = [
8 ../../shared/desktop/firefox.nix
9 ];
10
11 programs.firefox = {
12 profiles.default = {
13 userChrome = ''
14 /* hide tab close buttons when tab bar collapsed */
15 /* https://www.reddit.com/r/firefox/comments/1klv475/comment/ms5sf93/ */
16 #tabbrowser-tabs[orient=vertical]:not([expanded]) .tabbrowser-tab .tab-close-button {
17 display: none !important;
18 }
19 '';
20
21 settings = {
22 "sidebar.verticalTabs" = true;
23 "sidebar.main.tools" = "history";
24 "browser.toolbars.bookmarks.visibility" = "never";
25
26 "browser.newtabpage.enabled" = false;
27 "browser.startup.page" = 0;
28
29 "browser.sessionstore.resume_from_crash" = false;
30
31 "browser.download.autohideButton" = false;
32 "browser.uiCustomization.horizontalTabstrip" = "[\"tabbrowser-tabs\",\"new-tab-button\"]";
33 "browser.uiCustomization.navBarWhenVerticalTabs" =
34 "[\"sidebar-button\",\"back-button\",\"forward-button\",\"stop-reload-button\",\"vertical-spacer\",\"urlbar-container\",\"_61a05c39-ad45-4086-946f-32adb0a40a9d_-browser-action\",\"unified-extensions-button\",\"downloads-button\"]";
35
36 "browser.urlbar.suggest.history" = false;
37 "browser.urlbar.suggest.recentsearches" = false;
38
39 "extensions.formautofill.addresses.enabled" = false;
40 "extensions.formautofill.creditCards.enabled" = false;
41
42 "dom.security.https_only_mode" = true;
43
44 "privacy.fingerprintingProtection" = true;
45 "privacy.trackingprotection.enabled" = true;
46 "browser.safebrowsing.malware.enabled" = false;
47 "browser.safebrowsing.phishing.enabled" = false;
48 };
49
50 # TODO: configure them too
51 extensions = {
52 packages = with pkgs-firefox-addons; [
53 fastforwardteam
54 indie-wiki-buddy
55 linkwarden
56 ];
57
58 force = true;
59 };
60
61 search = {
62 default = "kagi";
63
64 engines = {
65 kagi = {
66 name = "Kagi";
67 definedAliases = [ "@kagi" ];
68
69 iconMapObj."16" = "https://kagi.com/favicon.ico";
70
71 urls = [
72 {
73 template = "https://kagi.com/search";
74 params = [
75 {
76 name = "q";
77 value = "{searchTerms}";
78 }
79 ];
80 }
81 ];
82 };
83
84 minecraft-wiki = {
85 name = "Minecraft Wiki";
86 definedAliases = [ "@minecraft-wiki" ];
87
88 iconMapObj."16" = "https://minecraft.wiki/favicon.ico";
89
90 urls = [
91 {
92 template = "https://minecraft.wiki/w/Special:Search";
93 params = [
94 {
95 name = "search";
96 value = "{searchTerms}";
97 }
98 ];
99 }
100 ];
101 };
102
103 nixos-wiki = {
104 name = "NixOS Wiki";
105 definedAliases = [ "@nixos-wiki" ];
106
107 iconMapObj."16" = nixosIcon;
108
109 urls = [
110 {
111 template = "https://wiki.nixos.org/w/index.php";
112 params = [
113 {
114 name = "search";
115 value = "{searchTerms}";
116 }
117 ];
118 }
119 ];
120 };
121
122 nix-packages = {
123 name = "Nix Packages";
124 definedAliases = [ "@nixpkgs" ];
125
126 iconMapObj."16" = nixosIcon;
127
128 urls = [
129 {
130 template = "https://search.nixos.org/packages";
131 params = [
132 {
133 name = "query";
134 value = "{searchTerms}";
135 }
136 ];
137 }
138 ];
139 };
140
141 nixos-options = {
142 name = "NixOS Options";
143 definedAliases = [ "@nixos" ];
144
145 iconMapObj."16" = nixosIcon;
146
147 urls = [
148 {
149 template = "https://search.nixos.org/options";
150 params = [
151 {
152 name = "query";
153 value = "{searchTerms}";
154 }
155 ];
156 }
157 ];
158 };
159
160 home-options = {
161 name = "Home Options";
162 definedAliases = [
163 "@home-options"
164 "@home-manager"
165 ];
166
167 iconMapObj."16" = "https://home-manager-options.extranix.com/images/favicon.ico";
168
169 urls = [
170 {
171 template = "https://home-manager-options.extranix.com/";
172 params = [
173 {
174 name = "query";
175 value = "{searchTerms}";
176 }
177 ];
178 }
179 ];
180 };
181
182 wikipedia.definedAliases = [ "@wiki" ];
183
184 amazondotcom-us.metaData.hidden = true;
185 bing.metaData.hidden = true;
186 ebay.metaData.hidden = true;
187 perplexity.metaData.hidden = true;
188 };
189
190 order = [
191 "kagi"
192 "ddg"
193 "google"
194 "wikipedia"
195 "minecraft-wiki"
196 "nixos-wiki"
197 "nix-packages"
198 "nixos-options"
199 "home-options"
200 ];
201 };
202 };
203 };
204}