2024-08-05 20:31:34 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
inputs,
|
|
|
|
...
|
|
|
|
}:
|
2023-05-18 01:56:19 +02:00
|
|
|
let
|
|
|
|
# {{{ Global extensions
|
2024-02-12 14:32:33 +01:00
|
|
|
extensions = with inputs.firefox-addons.packages.${pkgs.system}; [
|
2023-05-18 01:56:19 +02:00
|
|
|
buster-captcha-solver
|
2023-09-13 17:42:37 +02:00
|
|
|
# REASON: returns 404 for now
|
|
|
|
# bypass-paywalls-clean
|
2023-05-18 01:56:19 +02:00
|
|
|
clearurls # removes ugly args from urls
|
2023-09-13 17:42:37 +02:00
|
|
|
cliget # Generates curl commands for downloading account-protected things
|
2023-05-18 01:56:19 +02:00
|
|
|
don-t-fuck-with-paste # disallows certain websites from disabling pasting
|
2023-09-13 17:42:37 +02:00
|
|
|
decentraleyes # Serves local copies of a bunch of things instead of reaching a CDN
|
2023-05-18 01:56:19 +02:00
|
|
|
gesturefy # mouse gestures
|
2023-11-11 06:55:14 +01:00
|
|
|
indie-wiki-buddy # redirects fandom wiki urls to the proper wikis
|
2023-05-18 01:56:19 +02:00
|
|
|
i-dont-care-about-cookies
|
|
|
|
localcdn # caches libraries locally
|
|
|
|
privacy-badger # blocks some trackers
|
|
|
|
privacy-pass # captcha stuff
|
2024-04-23 08:33:17 +02:00
|
|
|
privacy-redirect # allows redirecting to my own instances for certain apps
|
2023-05-18 01:56:19 +02:00
|
|
|
skip-redirect # attempts to skip to the final reddirect for certain urls
|
|
|
|
terms-of-service-didnt-read
|
|
|
|
translate-web-pages
|
|
|
|
ublock-origin
|
|
|
|
unpaywall
|
|
|
|
user-agent-string-switcher
|
2024-02-12 14:32:33 +01:00
|
|
|
];
|
2023-05-18 01:56:19 +02:00
|
|
|
in
|
2024-08-05 20:31:34 +02:00
|
|
|
# }}}
|
2023-01-12 20:49:08 +01:00
|
|
|
{
|
|
|
|
programs.firefox = {
|
|
|
|
enable = true;
|
2023-05-18 01:56:19 +02:00
|
|
|
|
2024-02-12 14:32:33 +01:00
|
|
|
policies = {
|
|
|
|
DisableAppUpdate = true;
|
|
|
|
DisableBuiltinPDFViewer = true;
|
|
|
|
DisableFirefoxStudies = true;
|
|
|
|
DisablePocket = true;
|
|
|
|
DisableTelemetry = true;
|
|
|
|
DisplayBookmarksToolbar = "never";
|
|
|
|
DontCheckDefaultBrowser = true;
|
|
|
|
EnableTrackingProtection = {
|
|
|
|
Value = true;
|
|
|
|
Locked = true;
|
|
|
|
Cryptomining = true;
|
|
|
|
Fingerprinting = true;
|
|
|
|
};
|
|
|
|
OfferToSaveLogins = false;
|
|
|
|
PasswordManagerEnabled = false;
|
|
|
|
};
|
|
|
|
|
2024-05-21 01:37:39 +02:00
|
|
|
profiles.${config.home.username} = {
|
2023-04-27 01:08:20 +02:00
|
|
|
# {{{ High level user settings
|
2023-01-12 20:49:08 +01:00
|
|
|
# Unique user id
|
|
|
|
id = 0;
|
|
|
|
|
|
|
|
# Make this the default user
|
|
|
|
isDefault = true;
|
|
|
|
|
2023-04-27 01:08:20 +02:00
|
|
|
# Forcefully replace the search configuration
|
2023-01-12 20:49:08 +01:00
|
|
|
search.force = true;
|
2024-02-12 14:32:33 +01:00
|
|
|
search.default = "Moonythm";
|
2023-05-03 18:08:02 +02:00
|
|
|
|
2024-04-13 22:42:29 +02:00
|
|
|
# Set styles applied to firefox itself
|
|
|
|
userChrome = builtins.readFile ./userChrome.css;
|
2023-04-27 01:08:20 +02:00
|
|
|
# }}}
|
|
|
|
# {{{ Extensions
|
2023-11-13 04:03:14 +01:00
|
|
|
extensions =
|
|
|
|
with inputs.firefox-addons.packages.${pkgs.system};
|
2024-08-05 20:31:34 +02:00
|
|
|
with lib.lists;
|
|
|
|
flatten [
|
2023-11-13 04:03:14 +01:00
|
|
|
extensions
|
|
|
|
# List of profile-specific extensions
|
|
|
|
[
|
|
|
|
augmented-steam # Adds more info to steam
|
2024-02-12 14:32:33 +01:00
|
|
|
bitwarden # Password manager
|
2023-11-13 04:03:14 +01:00
|
|
|
blocktube # Lets you block youtube channels
|
|
|
|
dearrow # Crowdsourced clickbait remover 💀
|
2024-02-28 07:16:21 +01:00
|
|
|
leechblock-ng # website blocker
|
2023-11-13 04:03:14 +01:00
|
|
|
lovely-forks # displays forks on github
|
|
|
|
octolinker # github import to link thingy
|
|
|
|
octotree # github file tree
|
|
|
|
refined-github # a bunch of github modifications
|
|
|
|
return-youtube-dislikes
|
|
|
|
steam-database # adds info from steamdb on storepages
|
|
|
|
sponsorblock # skip youtube sponsors
|
|
|
|
vimium-c # vim keybinds
|
|
|
|
youtube-shorts-block
|
|
|
|
]
|
|
|
|
];
|
2023-04-27 01:08:20 +02:00
|
|
|
# }}}
|
|
|
|
# {{{ Search engines
|
|
|
|
search.engines =
|
|
|
|
let
|
|
|
|
# {{{ Search engine creation helpers
|
2024-08-05 20:31:34 +02:00
|
|
|
mkBasicSearchEngine =
|
|
|
|
{
|
|
|
|
aliases,
|
|
|
|
url,
|
|
|
|
param,
|
|
|
|
icon ? null,
|
|
|
|
}:
|
|
|
|
{
|
|
|
|
urls = [
|
|
|
|
{
|
|
|
|
template = url;
|
|
|
|
params = [
|
|
|
|
{
|
|
|
|
name = param;
|
|
|
|
value = "{searchTerms}";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
2023-04-27 01:08:20 +02:00
|
|
|
];
|
2024-08-05 20:31:34 +02:00
|
|
|
|
|
|
|
definedAliases = aliases;
|
|
|
|
}
|
|
|
|
// (if icon == null then { } else { inherit icon; });
|
|
|
|
|
|
|
|
mkNixPackagesEngine =
|
|
|
|
{ aliases, type }:
|
|
|
|
mkBasicSearchEngine {
|
|
|
|
aliases = aliases;
|
|
|
|
url = "https://search.nixos.org/${type}";
|
|
|
|
param = "query";
|
|
|
|
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
|
|
|
};
|
2023-04-27 01:08:20 +02:00
|
|
|
in
|
2024-08-05 20:31:34 +02:00
|
|
|
# }}}
|
2023-04-27 01:08:20 +02:00
|
|
|
# {{{ Engine declarations
|
|
|
|
{
|
|
|
|
"Nix Packages" = mkNixPackagesEngine {
|
2024-08-05 20:31:34 +02:00
|
|
|
aliases = [
|
|
|
|
"@np"
|
|
|
|
"@nix-packages"
|
|
|
|
];
|
2023-04-27 01:08:20 +02:00
|
|
|
type = "packages";
|
|
|
|
};
|
|
|
|
|
|
|
|
"Nix options" = mkNixPackagesEngine {
|
2024-08-05 20:31:34 +02:00
|
|
|
aliases = [
|
|
|
|
"@no"
|
|
|
|
"@nix-options"
|
|
|
|
];
|
2023-04-27 01:08:20 +02:00
|
|
|
type = "options";
|
|
|
|
};
|
|
|
|
|
2024-08-31 18:38:31 +02:00
|
|
|
"Home-manager options" = mkBasicSearchEngine {
|
|
|
|
aliases = [
|
|
|
|
"@hm"
|
|
|
|
"@home-manager"
|
|
|
|
];
|
|
|
|
param = "query";
|
|
|
|
url = "https://home-manager-options.extranix.com";
|
|
|
|
};
|
|
|
|
|
2023-04-27 01:08:20 +02:00
|
|
|
"Pursuit" = mkBasicSearchEngine {
|
|
|
|
url = "https://pursuit.purescript.org/search";
|
|
|
|
param = "q";
|
2024-08-05 20:31:34 +02:00
|
|
|
aliases = [
|
|
|
|
"@ps"
|
|
|
|
"@pursuit"
|
|
|
|
];
|
2023-04-27 01:08:20 +02:00
|
|
|
};
|
|
|
|
|
2023-08-22 17:24:04 +02:00
|
|
|
"Hoogle" = mkBasicSearchEngine {
|
|
|
|
url = "https://hoogle.haskell.org";
|
|
|
|
param = "hoogle";
|
2024-08-05 20:31:34 +02:00
|
|
|
aliases = [
|
|
|
|
"@hg"
|
|
|
|
"@hoogle"
|
|
|
|
];
|
2023-08-22 17:24:04 +02:00
|
|
|
};
|
|
|
|
|
2024-10-11 12:16:46 +02:00
|
|
|
"NPM" = mkBasicSearchEngine {
|
|
|
|
url = "https://www.npmjs.com/search";
|
|
|
|
param = "q";
|
|
|
|
aliases = [ "@npm" ];
|
|
|
|
};
|
|
|
|
|
2023-04-27 01:08:20 +02:00
|
|
|
"Wikipedia" = mkBasicSearchEngine {
|
|
|
|
url = "https://en.wikipedia.org/wiki/Special:Search";
|
|
|
|
param = "search";
|
2024-08-05 20:31:34 +02:00
|
|
|
aliases = [
|
|
|
|
"@wk"
|
|
|
|
"@wikipedia"
|
|
|
|
];
|
2023-04-27 01:08:20 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
"Github" = mkBasicSearchEngine {
|
|
|
|
url = "https://github.com/search";
|
|
|
|
param = "q";
|
2024-08-05 20:31:34 +02:00
|
|
|
aliases = [
|
|
|
|
"@gh"
|
|
|
|
"@github"
|
|
|
|
];
|
2023-04-27 01:08:20 +02:00
|
|
|
};
|
|
|
|
|
2024-04-27 21:38:06 +02:00
|
|
|
"Invidious" = mkBasicSearchEngine {
|
|
|
|
url = "https://yt.moonythm.dev/results";
|
|
|
|
param = "search_query";
|
2024-08-05 20:31:34 +02:00
|
|
|
aliases = [
|
|
|
|
"@yt"
|
|
|
|
"@invidious"
|
|
|
|
];
|
2024-04-27 21:38:06 +02:00
|
|
|
};
|
|
|
|
|
2023-04-27 01:08:20 +02:00
|
|
|
"Youtube" = mkBasicSearchEngine {
|
|
|
|
url = "https://www.youtube.com/results";
|
|
|
|
param = "search_query";
|
2024-08-05 20:31:34 +02:00
|
|
|
aliases = [
|
|
|
|
"@gyt"
|
|
|
|
"@youtube"
|
|
|
|
];
|
2023-04-27 01:08:20 +02:00
|
|
|
};
|
|
|
|
|
2023-12-15 03:53:22 +01:00
|
|
|
"Arcaea wiki" = mkBasicSearchEngine {
|
|
|
|
url = "https://arcaea.fandom.com/wiki/Special:Search?scope=internal&navigationSearch=true";
|
|
|
|
param = "query";
|
2024-08-05 20:31:34 +02:00
|
|
|
aliases = [
|
|
|
|
"@ae"
|
|
|
|
"@arcaea"
|
|
|
|
];
|
2023-12-15 03:53:22 +01:00
|
|
|
};
|
|
|
|
|
2023-04-27 01:08:20 +02:00
|
|
|
"Noita wiki" = mkBasicSearchEngine {
|
|
|
|
url = "https://noita.wiki.gg/index.php";
|
|
|
|
param = "search";
|
|
|
|
aliases = [ "@noita" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
"Rain world wiki" = mkBasicSearchEngine {
|
|
|
|
url = "https://rainworld.miraheze.org/w/index.php";
|
|
|
|
param = "search";
|
2024-08-05 20:31:34 +02:00
|
|
|
aliases = [
|
|
|
|
"@rw"
|
|
|
|
"@rain-world"
|
|
|
|
];
|
2023-04-27 01:08:20 +02:00
|
|
|
};
|
|
|
|
|
2023-06-18 18:10:20 +02:00
|
|
|
"Arch wiki" = mkBasicSearchEngine {
|
|
|
|
url = "https://wiki.archlinux.org/index.php";
|
|
|
|
param = "search";
|
2024-08-05 20:31:34 +02:00
|
|
|
aliases = [
|
|
|
|
"@aw"
|
|
|
|
"@arch-wiki"
|
|
|
|
];
|
2023-06-18 18:10:20 +02:00
|
|
|
};
|
|
|
|
|
2023-04-27 01:08:20 +02:00
|
|
|
"Factorio wiki" = mkBasicSearchEngine {
|
|
|
|
url = "https://wiki.factorio.com/index.php";
|
|
|
|
param = "search";
|
2024-08-05 20:31:34 +02:00
|
|
|
aliases = [
|
|
|
|
"@fw"
|
|
|
|
"@factorio-wiki"
|
|
|
|
];
|
2023-04-27 01:08:20 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
"Factorio mod portal" = mkBasicSearchEngine {
|
|
|
|
url = "https://mods.factorio.com/";
|
|
|
|
param = "query";
|
2024-08-05 20:31:34 +02:00
|
|
|
aliases = [
|
|
|
|
"@fm"
|
|
|
|
"@factorio-mods"
|
|
|
|
];
|
2023-04-27 01:08:20 +02:00
|
|
|
};
|
|
|
|
|
2024-02-12 14:32:33 +01:00
|
|
|
"Moonythm" = mkBasicSearchEngine {
|
|
|
|
url = "https://search.moonythm.dev/search";
|
|
|
|
param = "q";
|
2024-08-05 20:31:34 +02:00
|
|
|
aliases = [
|
|
|
|
"@m"
|
|
|
|
"@moonythm"
|
|
|
|
];
|
2024-02-24 03:51:35 +01:00
|
|
|
icon = ../../../../common/icons/whoogle.webp;
|
2024-02-12 14:32:33 +01:00
|
|
|
};
|
|
|
|
|
2023-04-27 01:08:20 +02:00
|
|
|
"Google".metaData.alias = "@g";
|
2023-01-12 20:49:08 +01:00
|
|
|
};
|
2023-04-27 01:08:20 +02:00
|
|
|
# }}}
|
|
|
|
# }}}
|
|
|
|
# {{{ Other lower level settings
|
2023-03-16 17:39:46 +01:00
|
|
|
settings = {
|
|
|
|
# Required for figma to be able to export to svg
|
|
|
|
"dom.events.asyncClipboard.clipboardItem" = true;
|
2023-05-03 18:08:02 +02:00
|
|
|
|
2023-11-15 17:43:12 +01:00
|
|
|
# Allow custom css
|
2023-05-03 18:08:02 +02:00
|
|
|
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
|
|
|
|
|
|
|
# Set language to english
|
|
|
|
"general.useragent.locale" = "en-GB";
|
2023-05-24 03:17:09 +02:00
|
|
|
|
|
|
|
# Do not restore sessions after what looks like a "crash"
|
|
|
|
"browser.sessionstore.resume_from_crash" = false;
|
|
|
|
|
2024-05-07 03:03:10 +02:00
|
|
|
# Do not paste with middle mouse click
|
|
|
|
"middlemouse.paste" = false;
|
|
|
|
|
2024-08-30 01:10:41 +02:00
|
|
|
# Do not include "switch to [tab]" in search results
|
|
|
|
"browser.urlbar.suggest.openpage" = false;
|
|
|
|
|
|
|
|
# Disable shortcut for quitting :)
|
|
|
|
"browser.quitShortcut.disabled" = true;
|
|
|
|
|
2024-11-27 06:02:03 +01:00
|
|
|
# Keep the reader button enabled at all times; really don't
|
|
|
|
# care if it doesn't work 20% of the time, most websites are
|
|
|
|
# crap and unreadable without this
|
|
|
|
"reader.parse-on-load.force-enabled" = true;
|
|
|
|
|
|
|
|
# Hide the "sharing indicator", it's especially annoying
|
|
|
|
# with tiling WMs on wayland
|
|
|
|
"privacy.webrtc.legacyGlobalIndicator" = false;
|
|
|
|
|
|
|
|
# Hide random popup:
|
|
|
|
# https://forums.linuxmint.com/viewtopic.php?t=379164
|
|
|
|
"browser.protections_panel.infoMessage.seen" = true;
|
|
|
|
|
|
|
|
# Do not show dialog for getting panes in the addons menu (?)
|
|
|
|
# http://kb.mozillazine.org/Extensions.getAddons.showPane
|
|
|
|
"extensions.getAddons.showPane" = false;
|
|
|
|
|
|
|
|
# Do not recommend addons
|
|
|
|
"extensions.htmlaboutaddons.recommendations.enabled" = false;
|
|
|
|
|
2023-11-15 17:43:12 +01:00
|
|
|
# Inspired by https://github.com/TLATER/dotfiles/blob/b39af91fbd13d338559a05d69f56c5a97f8c905d/home-config/config/graphical-applications/firefox.nix
|
|
|
|
# {{{ Performance settings
|
|
|
|
"gfx.webrender.all" = true; # Force enable GPU acceleration
|
|
|
|
"media.ffmpeg.vaapi.enabled" = true;
|
|
|
|
"widget.dmabuf.force-enabled" = true; # Required in recent Firefoxes
|
|
|
|
# }}}
|
2024-08-05 20:31:34 +02:00
|
|
|
# {{{ New tab page
|
|
|
|
"browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = false;
|
|
|
|
"browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = false;
|
2023-11-15 17:43:12 +01:00
|
|
|
"browser.newtabpage.activity-stream.feeds.snippets" = false;
|
|
|
|
"browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts.havePinned" = "";
|
|
|
|
"browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts.searchEngines" = "";
|
2024-08-05 20:31:34 +02:00
|
|
|
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false;
|
2023-11-15 17:43:12 +01:00
|
|
|
"browser.newtabpage.activity-stream.showSponsored" = false;
|
|
|
|
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
|
|
|
|
"browser.newtabpage.pinned" = false;
|
|
|
|
# }}}
|
|
|
|
# {{{ Privacy
|
|
|
|
"browser.contentblocking.category" = "strict";
|
|
|
|
"app.shield.optoutstudies.enabled" = false;
|
|
|
|
"dom.security.https_only_mode" = true;
|
|
|
|
"dom.security.https_only_mode_ever_enabled" = true;
|
|
|
|
"datareporting.policy.dataSubmissionEnable" = false;
|
|
|
|
"datareporting.policy.dataSubmissionPolicyAcceptedVersion" = 2;
|
|
|
|
"privacy.trackingprotection.enabled" = true;
|
|
|
|
"privacy.trackingprotection.socialtracking.enabled" = true;
|
|
|
|
"browser.discovery.enabled" = false;
|
|
|
|
# }}}
|
2023-03-16 17:39:46 +01:00
|
|
|
};
|
2023-04-27 01:08:20 +02:00
|
|
|
# }}}
|
2023-01-12 20:49:08 +01:00
|
|
|
};
|
2023-01-15 23:04:11 +01:00
|
|
|
|
2023-04-27 01:08:20 +02:00
|
|
|
# {{{ Standalone "apps" which actually run inside a browser.
|
2023-05-18 01:56:19 +02:00
|
|
|
apps.extensions = extensions;
|
|
|
|
apps.app = {
|
2023-07-07 21:25:05 +02:00
|
|
|
# {{{ Desmos
|
2023-03-20 20:02:01 +01:00
|
|
|
desmos = {
|
|
|
|
url = "https://www.desmos.com/calculator";
|
2024-02-24 03:51:35 +01:00
|
|
|
icon = ../../../../common/icons/desmos.png;
|
2023-03-20 20:02:01 +01:00
|
|
|
displayName = "Desmos";
|
2024-01-04 05:24:55 +01:00
|
|
|
id = 1;
|
2023-03-20 20:02:01 +01:00
|
|
|
};
|
2023-07-07 21:25:05 +02:00
|
|
|
# }}}
|
|
|
|
# {{{ Monkey type
|
2023-05-18 01:56:19 +02:00
|
|
|
monkey-type = {
|
|
|
|
url = "https://monkeytype.com/";
|
2024-02-24 03:51:35 +01:00
|
|
|
icon = ../../../../common/icons/monkeytype.png;
|
2023-05-18 01:56:19 +02:00
|
|
|
displayName = "Monkeytype";
|
2024-01-04 05:24:55 +01:00
|
|
|
id = 2;
|
2023-05-18 01:56:19 +02:00
|
|
|
};
|
2023-07-07 21:25:05 +02:00
|
|
|
# }}}
|
2023-03-12 05:24:25 +01:00
|
|
|
};
|
2023-04-27 01:08:20 +02:00
|
|
|
# }}}
|
2023-03-12 05:24:25 +01:00
|
|
|
};
|
2023-04-27 01:08:20 +02:00
|
|
|
|
2024-07-26 20:18:26 +02:00
|
|
|
stylix.targets.firefox = {
|
|
|
|
enable = true;
|
2024-08-05 20:31:34 +02:00
|
|
|
profileNames = [
|
|
|
|
config.home.username
|
|
|
|
"desmos"
|
|
|
|
"monkey-type"
|
|
|
|
];
|
2024-07-26 20:18:26 +02:00
|
|
|
};
|
2024-01-04 05:24:55 +01:00
|
|
|
|
2024-11-27 06:02:03 +01:00
|
|
|
# {{{ Make firefox the default browser
|
2023-04-27 01:08:20 +02:00
|
|
|
# Use firefox as the default browser to open stuff.
|
2023-04-27 15:36:14 +02:00
|
|
|
xdg.mimeApps.defaultApplications = {
|
|
|
|
"text/html" = [ "firefox.desktop" ];
|
|
|
|
"text/xml" = [ "firefox.desktop" ];
|
|
|
|
"x-scheme-handler/http" = [ "firefox.desktop" ];
|
|
|
|
"x-scheme-handler/https" = [ "firefox.desktop" ];
|
|
|
|
};
|
2023-04-27 01:08:20 +02:00
|
|
|
|
|
|
|
# Tell apps firefox is the default browser using an env var.
|
|
|
|
home.sessionVariables.BROWSER = "firefox";
|
|
|
|
# }}}
|
|
|
|
# {{{ Persistence
|
2023-12-13 19:30:04 +01:00
|
|
|
satellite.persistence.at.state.apps.firefox.directories = [
|
2023-04-27 01:08:20 +02:00
|
|
|
".mozilla/firefox" # More important stuff
|
|
|
|
];
|
2023-06-09 13:17:34 +02:00
|
|
|
|
2023-12-13 19:30:04 +01:00
|
|
|
satellite.persistence.at.cache.apps.firefox.directories = [
|
2023-06-09 13:17:34 +02:00
|
|
|
"${config.xdg.cacheHome}/mozilla/firefox" # Non important cache
|
|
|
|
];
|
2023-04-27 01:08:20 +02:00
|
|
|
# }}}
|
2023-01-12 20:49:08 +01:00
|
|
|
}
|