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