nix/home-manager/modules/firefox.nix

221 lines
11 KiB
Nix
Raw Normal View History

2024-11-21 22:31:12 -07:00
{ pkgs, inputs, system, ... }:
{
programs.firefox = {
enable = true;
policies = {
ExtensionSettings = {
# Force install alpenglow theme (why wouldn't you want it)
"firefox-alpenglow@mozilla.org" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/firefox-alpenglow/latest.xpi";
installation_mode = "force_installed";
};
};
};
profiles = {
default = {
id = 0;
name = "default";
isDefault = true;
# Settings
settings = {
# Theming
"extensions.activeThemeID" = "firefox-alpenglow@mozilla.org"; # Purple
"browser.tabs.inTitlebar" = 0; # Enable native title bar
"browser.uidensity" = 2; # Touchscreen density
"browser.newtab.extensionControlled" = true; # Tabliss
"browser.startup.homepage_override.extensionControlled" = true; # More tabliss
# Extensions
"extensions.autoDisableScopes" = 0; # Auto enable extensions
2024-11-24 02:21:03 -07:00
"extensions.enabledScopes" = 15;
2024-11-21 22:31:12 -07:00
# Basic options
"privacy.userContext.newTabContainerOnLeftClick.enabled" = true; # Container selection on +
"findbar.highlightAll" = true; # Highlight all search results in Ctrl+F
2024-11-21 22:31:12 -07:00
# Toolbar customization
2024-11-29 15:39:02 -07:00
"browser.download.autohideButton" = false;
2024-11-21 22:31:12 -07:00
"browser.uiCustomization.state" = ''
{
"placements": {
"widget-overflow-fixed-list": [],
2024-11-24 02:21:03 -07:00
"unified-extensions-area": [
"sponsorblocker_ajay_app-browser-action",
"firefox-addon_pronoundb_org-browser-action",
"gdpr_cavi_au_dk-browser-action",
"7esoorv3_alefvanoon_anonaddy_me-browser-action",
"addon_fastforward_team-browser-action",
"jid1-aqqsmbyb0a8adg_jetpack-browser-action",
"_e58d3966-3d76-4cd9-8552-1582fbc800c1_-browser-action",
"plasma-browser-integration_kde_org-browser-action"
],
2024-11-21 22:31:12 -07:00
"nav-bar": [
"back-button",
"forward-button",
"stop-reload-button",
"urlbar-container",
"save-to-pocket-button",
"fxa-toolbar-menu-button",
2024-11-29 15:39:02 -07:00
"downloads-button",
2024-11-21 22:31:12 -07:00
"unified-extensions-button",
2024-11-29 15:39:02 -07:00
"reset-pbm-toolbar-button",
2024-11-24 02:21:03 -07:00
"addon_darkreader_org-browser-action",
"_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action",
2024-11-21 22:31:12 -07:00
"ublock0_raymondhill_net-browser-action",
2024-11-24 02:21:03 -07:00
"_799c0914-748b-41df-a25c-22d008f9e83f_-browser-action"
2024-11-21 22:31:12 -07:00
],
"toolbar-menubar": [
"menubar-items"
],
"TabsToolbar": [
2024-11-24 02:21:03 -07:00
"home-button",
2024-11-21 22:31:12 -07:00
"new-tab-button",
2024-11-24 02:21:03 -07:00
"tabbrowser-tabs",
2024-11-21 22:31:12 -07:00
"alltabs-button"
],
"vertical-tabs": [],
"PersonalToolbar": [
"import-button",
"personal-bookmarks"
]
},
"seen": [
"reset-pbm-toolbar-button",
"profiler-button",
"developer-button",
"ublock0_raymondhill_net-browser-action",
2024-11-24 02:21:03 -07:00
"_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action",
"firefox-addon_pronoundb_org-browser-action",
"gdpr_cavi_au_dk-browser-action",
"7esoorv3_alefvanoon_anonaddy_me-browser-action",
"addon_darkreader_org-browser-action",
"addon_fastforward_team-browser-action",
"jid1-aqqsmbyb0a8adg_jetpack-browser-action",
"_e58d3966-3d76-4cd9-8552-1582fbc800c1_-browser-action",
"plasma-browser-integration_kde_org-browser-action",
"sponsorblocker_ajay_app-browser-action",
"_799c0914-748b-41df-a25c-22d008f9e83f_-browser-action"
2024-11-21 22:31:12 -07:00
],
"dirtyAreaCache": [
"nav-bar",
"vertical-tabs",
"PersonalToolbar",
"toolbar-menubar",
"TabsToolbar",
"unified-extensions-area"
],
"currentVersion": 20,
2024-11-29 15:39:02 -07:00
"newElementCount": 9
2024-11-21 22:31:12 -07:00
}
'';
};
# Search engine configuration
search = {
force = true;
default = "SearXNG";
order = [
"SearXNG"
"Google"
"Wikipedia"
"Nix Packages"
"NixOS Options"
"Home Manager Options"
"NixOS Wiki"
];
2024-11-21 22:31:12 -07:00
engines = {
# Nix Package Search
"Nix Packages" = {
urls = [{
template = "https://search.nixos.org/packages";
params = [
{ name = "type"; value = "packages"; }
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
2024-11-21 22:31:12 -07:00
definedAliases = [ "@np" ];
};
2024-11-22 12:29:00 -07:00
# NixOS Options Search
"NixOS Options" = {
urls = [{
template = "https://search.nixos.org/options";
params = [
{ name = "type"; value = "packages"; }
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
2024-11-22 12:29:00 -07:00
definedAliases = [ "@no" ];
};
# Nix Home-Manager options search
"Home Manager Options" = {
urls = [{
template = "https://home-manager-options.extranix.com";
params = [{ name = "query"; value = "{searchTerms}"; }];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@ho" ];
};
2024-11-21 22:31:12 -07:00
# NixOS Wiki Search
"NixOS Wiki" = {
urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }];
iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@nw" ];
};
# Personal SearXNG instance
"SearXNG" = {
urls = [{ template = "https://search.myriation.xyz/?q={searchTerms}"; }];
iconUpdateURL = "https://search.myriation.xyz/static/themes/simple/img/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@sx" "@searx" ];
};
"Bing".metaData.hidden = true;
"eBay".metaData.hidden = true;
"Amazon.com".metaData.hidden = true;
"DuckDuckGo".metaData.hidden = true;
};
};
# Extensions (NUR)
extensions = with inputs.firefox-addons.packages."${system}"; [
bitwarden
ublock-origin
tabliss
2024-11-24 02:21:03 -07:00
buster-captcha-solver # reCaptcha begone
consent-o-matic # Fuck cookie popups
darkreader # Dark mode on all website
fastforwardteam # Skip unnecessary short links
libredirect # Redirect to better private frontends
mailvelope # GPG Email encryption for the web
plasma-integration # KDE Plasma support
pronoundb # :3
sponsorblock # Sponsor & Intro skipping for youtube
web-scrobbler # Last.FM & ListenBrainz scrobbling
# TODO Request better-canvas
2024-11-21 22:31:12 -07:00
];
# Containers
containersForce = true;
containers = {
# The letters are a hack to sort the entries in firefox (it adds them alphabetically)
A-Personal = {
id = 2;
name = "Personal";
color = "purple";
icon = "fingerprint";
};
B-College = {
id = 1;
name = "College";
color = "orange";
icon = "fruit";
};
};
};
};
};
}