From a432aeafb95abe4a7b32ead634a671b559ecf597 Mon Sep 17 00:00:00 2001 From: krizej Date: Thu, 1 Aug 2024 22:11:12 +0200 Subject: [PATCH] firefox stuff --- modules/stuff/firefox.nix | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/modules/stuff/firefox.nix b/modules/stuff/firefox.nix index ee4f13d..3df3e6f 100644 --- a/modules/stuff/firefox.nix +++ b/modules/stuff/firefox.nix @@ -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;