{ config, lib, pkgs, ... }: { config = let buildFirefoxXpiAddon = lib.makeOverridable ({ stdenv ? pkgs.stdenv, fetchurl ? pkgs.fetchurl, pname, version, addonId, url, sha256, ... }: stdenv.mkDerivation { name = "${pname}-${version}"; src = fetchurl {inherit url sha256;}; preferLocalBuild = true; allowSubstitutes = true; buildCommand = '' dst="$out/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9397384}" mkdir -p "$dst" install -v -m644 "$src" "$dst/${addonId}.xpi" ''; }); extra-addons = { yomichan = buildFirefoxXpiAddon { pname = "yomichan"; version = "20.5.22.1"; addonId = "{a9226ee9-7998-47bd-b72e-a1b56df7f77b}"; url = "https://addons.mozilla.org/firefox/downloads/file/3585060/yomichan-20.5.22.1.xpi"; sha256 = "sha256-/icvPD/nCJYS31owfYMD25QzFjsxAqapy/UAehhxsy8="; }; }; in { programs.firefox = { enable = true; package = pkgs.firefox-devedition; profiles = { "schizo.dev-edition-default" = { id = 0; name = "dev-edition-default"; isDefault = true; search = { default = "SearXNG Sapti"; engines = { "SearXNG Sapti" = { urls = [{ template = "https://search.sapti.me/search?q={searchTerms}"; }]; iconUpdateURL = "https://search.sapti.me/favicon.ico"; updateInterval = 24 * 60 * 60 * 1000; definedAliases = [ "@sx" ]; }; "NixOS Packages" = { urls = [{ template = "https://search.nixos.org/packages"; params = [ { name = "channel"; value = "unstable"; } { 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 = "channel"; value = "unstable"; } { name = "query"; value = "{searchTerms}"; } ]; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@no" ]; }]; }; "NixOS Wiki" = { urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }]; iconUpdateURL = "https://nixos.wiki/favicon.png"; updateInterval = 24 * 60 * 60 * 1000; definedAliases = [ "@nw" ]; }; }; force = true; }; extensions = with pkgs.nur.repos.rycee.firefox-addons; [ ublock-origin sponsorblock tridactyl violentmonkey darkreader keepassxc-browser redirector auto-tab-discard extra-addons.yomichan ]; settings = { "extensions.pocket.enabled" = false; }; }; }; }; }; }