firefox stuff

This commit is contained in:
krizej 2024-08-01 22:11:12 +02:00
parent e0a5ba704d
commit a432aeafb9

View file

@ -1,6 +1,7 @@
{ lib, pkgs, config, ... }: let
cfg = config.chuj.stuff.firefox;
inherit (lib) mkIf mkEnableOption mkOption types;
cfg = config.chuj.stuff.firefox;
user = config.chuj.system.user;
in {
options.chuj.stuff.firefox = {
enable = mkEnableOption "firefox";
@ -27,7 +28,7 @@ in {
DisplayBookmarksToolbar = "always";
DisplayMenuBar = "default-off";
SearchBar = "unified";
DefaultDownloadDirectory = "$HOME/downloads";
DefaultDownloadDirectory = config.home-manager.users.${user}.xdg.userDirs.download;
ExtensionSettings = {
# ublock origin
"uBlock0@raymondhill.net" = {
@ -70,6 +71,13 @@ in {
"Google".metaData.alias = "@g";
"Wikipedia (en)".metaData.alias = "@w";
"Wikipedia (pl)" = {
urls = [ { template = "https://pl.wikipedia.org/w/index.php?search={searchTerms}"; } ];
icon = "https://pl.wikipedia.org/static/favicon/wikipedia.ico";
iconUpdateURL = "https://pl.wikipedia.org/static/favicon/wikipedia.ico";
updateInterval = 24 * 60 * 60 * 1000;
definedAliases = [ "@wpl" ];
};
"Nix Packages" = {
urls = [ { template = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}"; } ];
@ -96,15 +104,24 @@ in {
definedAliases = [ "@aw" ];
};
"NixOS Wiki" = {
# todo the other nix wiki
urls = [ { template = "https://nixos.wiki/index.php?search={searchTerms}&go=Go"; } ];
urls = [ { template = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; } ];
icon = "https://nixos.wiki/favicon.png";
iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000;
definedAliases = [ "@nw" ];
};
# todo: add polish wikipedia and wolfram alpha and noogle.dev
"Noogle" = {
urls = [ { template = "https://noogle.dev/q?term={searchTerms}"; } ];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@ng" ];
};
"Wolfram Alpha" = {
urls = [ { template = "https://www.wolframalpha.com/input?i={searchTerms}"; } ];
icon = "https://www.wolframalpha.com/_next/static/images/favicon_1zbE9hjk.ico";
iconUpdateURL = "https://www.wolframalpha.com/_next/static/images/favicon_1zbE9hjk.ico";
updateInterval = 24 * 60 * 60 * 1000;
definedAliases = [ "@wa" ];
};
# the rest can fuck off
"Bing".metaData.hidden = true;
@ -115,10 +132,11 @@ in {
settings = {
"extensions.activeThemeID" = "firefox-compact-dark@mozilla.org";
"services.sync.prefs.sync.extensions.activeThemeID" = "false";
"middlemouse.paste" = "false";
# https://git.jacekpoz.pl/jacekpoz/niksos/src/branch/master/modules/gui/firefox.nix#L405
# but modified (a bit)
"browser.aboutConfig.showWarning" = false;
"browser.startup.page" = 0;
"browser.startup.page" = 3;
"browser.startup.homepage" = "about:home";
"browser.newtabpage.enabled" = true;
"browser.newtabpage.activity-stream.showSponsored" = false;