{
  inputs,
  pkgs,
  config,
  ...
}: let
  global = import ../global-var.nix;
in {
  home-manager.users.${global.username} = {pkgs, ...}: {
    programs.firefox = {
      enable = true;
      profiles.noah = {
        isDefault = true;
        extensions = with config.nur.repos.rycee.firefox-addons; [
          ublock-origin
          return-youtube-dislikes
          yomitan
          furiganaize
          stylus
          youtube-shorts-block
          sponsorblock
          control-panel-for-twitter
          violentmonkey
          firefox-color
          tridactyl
        ];

        bookmarks = [
          {
            toolbar = true;
            name = "toolbar";
            bookmarks = [
              {
                name = "Linux";
                bookmarks = [
                  {
                    name = "Phoronix";
                    url = "https://www.phoronix.com/";
                  }
                ];
              }
              {
                name = "Nix";
                bookmarks = [
                  {
                    name = "Nixpkgs package search";
                    url = "https://search.nixos.org/packages";
                  }
                  {
                    name = "Nixpkg option search";
                    url = "https://search.nixos.org/options";
                  }
                  {
                    name = "Nixpkgs Github";
                    url = "https://github.com/NixOS/nixpkgs";
                  }
                  {
                    name = "Nix PR tracker";
                    url = "https://nixpk.gs/pr-tracker.html";
                  }
                  {
                    name = "NixOS Wiki";
                    url = "https://nixos.wiki/wiki/Main_Page";
                  }
                  {
                    name = "NixOS Manual";
                    url = "https://nixos.org/manual/nixos/stable/";
                  }
                  {
                    name = "Home Manager option search";
                    url = "https://home-manager-options.extranix.com/";
                  }
                  {
                    name = "Noogle";
                    url = "https://noogle.dev/";
                  }
                  {
                    name = "Nix package versions";
                    url = "https://lazamar.co.uk/nix-versions/";
                  }
                ];
              }
            ];
          }
        ];

        settings = {
          "browser.uiCustomization.state" = builtins.readFile ./firefox-uistate.json;
          "general.autoScroll" = true;
          "widget.use-xdg-desktop-portal.file-picker" = 1;
          "font.name-list.emoji" = "Joypixels";
          "browser.tabs.inTitlebar" = 0;
        };

        extraConfig = builtins.readFile (builtins.fetchurl {
          url = "https://raw.githubusercontent.com/yokoffing/Betterfox/main/user.js";
          sha256 = "0vfn3s7q4gm939a5cim1jlrr8k0f5pm4kxxsv1d9bwvv10pmz7pn";
        });

        search = {
          force = true;
          engines = {
            "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"];
            };
            "Brave" = {
              urls = [{template = "https://search.brave.com/search?q={searchTerms}";}];
              iconUpdateURL = "https://cdn.search.brave.com/serp/v2/_app/immutable/assets/favicon-32x32.B2iBzfXZ.png";
              updateInterval = 24 * 60 * 60 * 1000; # every day
              definedAliases = ["@br"];
            };
          };

          default = "Brave";
        };
      };
    };
  };
}
