{
  pkgs,
  user,
  dotfilepath,
  ...
}:
{
  home-manager.users.${user} = {
    programs.firefox = {
      enable = true;
      profiles = {
        "user" = {
          isDefault = true;
          id = 0;

          # TODO fix impurity
          extraConfig = builtins.readFile "${dotfilepath}/hosts/thinkpad/opt/firefox/user.js"; # custom userjs config
          userChrome = builtins.readFile "${dotfilepath}/hosts/thinkpad/opt/firefox/userChrome.css"; # browser styles
          userContent = builtins.readFile "${dotfilepath}/hosts/thinkpad/opt/firefox/userContent.css"; # browser styles

          extensions = with pkgs; [
            nur.repos.rycee.firefox-addons.ublock-origin
            nur.repos.rycee.firefox-addons.clearurls # clear tracking urls
            nur.repos.rycee.firefox-addons.stylus # cool styling for websites
            nur.repos.rycee.firefox-addons.localcdn # locally stores frameworks such as vue, tailwind ect..
            nur.repos.rycee.firefox-addons.libredirect # redirects to libre version of spyware sites
            nur.repos.rycee.firefox-addons.tridactyl # vim like keybinds
            nur.repos.rycee.firefox-addons.istilldontcareaboutcookies # dismisses cookie banners
            nur.repos.rycee.firefox-addons.noscript # block js
            nur.repos.rycee.firefox-addons.tabliss # sexy new tab
            nur.repos.rycee.firefox-addons.aw-watcher-web # activity watcher
            nur.repos.rycee.firefox-addons.stylus # styling
            nur.repos.rycee.firefox-addons.keepassxc-browser # password manager integration
          ];
          search.force = true;
          search.order = [
            "Searxng"
            "DuckDuckGo"
          ];
          search.default = "Searxng";
          search.engines = {
            "Nix Packages" = {
              urls = [
                {
                  template = "https://search.nixos.org/packages";
                  params = [
                    {
                      name = "type";
                      value = "packages";
                    }
                    {
                      name = "query";
                      value = "{searchTerms}";
                    }
                  ];
                }
              ];
              icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
              definedAliases = [ "@np" ];
            };
            "Searxng" = {
              urls = [
                {
                  template = "https://search.rhscz.eu/";
                  params = [
                    {
                      name = "q";
                      value = "{searchTerms}";
                    }
                  ];
                }
              ];
            };
            "Home Manager" = {
              definedAliases = [ "@hm" ];
              urls = [
                {
                  template = "https://home-manager-options.extranix.com/";
                  params = [
                    {
                      name = "query";
                      value = "{searchTerms}";
                    }
                    {
                      name = "release";
                      value = "release-24.11";
                    }
                  ];
                }
              ];
            };
            "Youtube" = {
              definedAliases = [ "@yt" ];
              urls = [
                {
                  template = "https://www.youtube.com/results";
                  params = [
                    {
                      name = "search_query";
                      value = "{searchTerms}";
                    }
                  ];
                }
              ];
            };
            "Nix Options" = {
              definedAliases = [ "@no" ];
              urls = [
                {
                  template = "https://search.nixos.org/options?type=packages";
                  params = [
                    {
                      name = "query";
                      value = "{searchTerms}";
                    }
                  ];
                }
              ];
            };
            "Nix Wiki" = {
              definedAliases = [ "@nw" ];
              urls = [
                {
                  template = "https://wiki.nixos.org/w/index.php";
                  params = [
                    {
                      name = "search";
                      value = "{searchTerms}";
                    }
                  ];
                }
              ];
            };
            "Rust crates" = {
              definedAliases = [ "@cr" ];
              urls = [
                {
                  template = "https://crates.io/search";
                  params = [
                    {
                      name = "q";
                      value = "{searchTerms}";
                    }
                  ];
                }
              ];
            };
          };
        };
      };
    };

  };
  programs.firejail = {
    wrappedBinaries = {
      firefox = {
        executable = "${pkgs.firefox}/bin/firefox";
        profile = "${pkgs.firejail}/etc/firejail/firefox.profile";
        desktop = "${pkgs.firefox}/share/applications/firefox.desktop";
      };
    };
  };

}