summaryrefslogtreecommitdiff
path: root/modules/home/firefox.nix
blob: db507a809ffc871b85ab286eef2ddfe5127d097a (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
{ userDetails, ... }: {
	programs.firefox = {
		# TODO see if there is way to login to moz account in profile
		enable = true;
		arkenfox = {
			enable = true;
		};
		profiles = let
			search = {
				engines = {
					"Timmy Search" = {
						urls = [{ template = "https://search.tjkeller.xyz/search?q={searchTerms}"; }];  # Don't know how to do w/ POST but I prefer GET anyways
						iconURI = "https://search.tjkeller.xyz/static/themes/simple/img/favicon.svg";  # TODO doesn't seem to work
					};
				};
				default = "Timmy Search";
				privateDefault = "Timmy Search";
				force = true;  # Overwrite old
			};
			userChrome = builtins.readFile ./resources/firefox/userChrome.css;
			arkenfox = {
				enable = true;
				enableAllSections = true;
				"0100"."0102"."browser.startup.page".value = 3;  # 0=blank, 1=home, 2=last visited page, 3=resume previous session
				"0100"."0103"."browser.startup.homepage".enable = false;
				"0100"."0104"."browser.newtabpage.enabled".enable = false;
				"2800"."2811"."privacy.clearOnShutdown.history".enable = false;
			};
			settings = {
				"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
				"browser.compactmode.show" = true;
				"browser.uidensity" = 1;  # Compact
				"browser.download.dir" = userDetails.home.downloads;  # FF will create this dir if it doesn't exist
				"browser.aboutConfig.showWarning" = false;  # arkenfox does
				"app.normandy.first_run" = false;
				"browser.uiCustomization.state" = builtins.readFile ./resources/firefox/uiCustomization.json;  # Toolbar etc.
				"browser.newtabpage.activity-stream.feeds.section.topstories" = false;
				"browser.newtabpage.activity-stream.feeds.topsites" = false;
				"general.smoothScroll" = false;
				"devtools.toolbox.host" = "window";
				#identity.fxaccounts.account.device.name = "timmy’s Firefox on nixos";  # HOSTNAME
			};
		in {
			Personal = {
				id = 0;
				isDefault = true;
				inherit search;
				inherit userChrome;
				inherit arkenfox;
				inherit settings;
			};
			Work = {
				id = 1;
				inherit search;
			};
		};
	};
}