blob: 7c95e562c7541da026d420b2f3b84d13174a2c7d (
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
113
|
{ config, lib, pkgs, ... }: let
cfg = config.programs.firefox;
search = {
engines = {
"Timmy Search" = {
urls = [{
template = "https://search.tjkeller.xyz/search";
params = [ { name = "q"; value = "{searchTerms}"; } ];
}];
iconURI = "https://search.tjkeller.xyz/static/themes/simple/img/favicon.svg"; # TODO doesn't seem to work
};
"Nix Packages" = {
urls = [{
template = "https://search.nixos.org/packages";
params = [ { name = "query"; value = "{searchTerms}"; } ];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"NixOS Options" = {
urls = [{
template = "https://search.nixos.org/options";
params = [ { name = "query"; value = "{searchTerms}"; } ];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
};
default = "Timmy Search";
privateDefault = "Timmy Search";
force = true; # Overwrite old
};
userChrome = builtins.readFile ./resources/firefox/userChrome.css;
uiCustomization = {
placements = {
nav-bar = [
"back-button"
"forward-button"
"stop-reload-button"
"vertical-spacer"
"home-button"
"urlbar-container"
"downloads-button"
"_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action" # Bitwarden
"unified-extensions-button"
];
TabsToolbar = [ "tabbrowser-tabs" "new-tab-button" ];
# Ensure these extensions go to overflow menu instead of nav-bar
unified-extensions-area = [
"ublock0_raymondhill_net-browser-action"
"sponsorblocker_ajay_app-browser-action"
];
};
currentVersion = 23; # Required
};
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 = {
"browser.compactmode.show" = true;
"browser.uiCustomization.state" = builtins.toJSON uiCustomization; # Toolbar etc.
"browser.uidensity" = 1; # Compact
"toolkit.legacyUserProfileCustomizations.stylesheets" = true; # userchrome
"app.normandy.first_run" = false;
"browser.aboutConfig.showWarning" = false; # arkenfox does
#"browser.download.dir" = userDetails.userDirs.downloads;
"browser.newtabpage.activity-stream.feeds.section.topstories" = false;
"browser.newtabpage.activity-stream.feeds.topsites" = false;
"browser.urlbar.suggest.topsites" = false;
"devtools.toolbox.host" = "window";
"dom.push.enabled" = false; #
"extensions.pocket.enabled" = false;
"general.smoothScroll" = false;
#"geo.provider.use_geoclue" = true;
};
workSettings = settings // {
"extensions.activeThemeID" = "firefox-compact-dark@mozilla.org"; # Use builtin dark theme instead of system theme
};
in {
options.programs.firefox = {
_configure = lib.mkEnableOption "configure firefox profiles";
};
config = lib.mkIf cfg._configure {
programs.firefox = {
enable = lib.mkDefault true;
arkenfox.enable = lib.mkDefault true;
profiles = {
Personal = {
id = 0;
isDefault = true;
inherit search;
inherit userChrome;
inherit arkenfox;
inherit settings;
};
Work = {
id = 1;
inherit search;
inherit userChrome;
inherit arkenfox;
settings = workSettings;
};
};
};
};
}
|