Files
nixos/apps/firefox/default.nix
T
kenji ae7d017d2b feat(firefox): generalize youtube profile into modular web-app profile
- Renamed profiles/youtube.nix to profiles/web-app.nix.

- Refactored to accept id, name, and url as arguments.

- Added settings to force homepage on startup and new tabs.

- Disabled session restore and undo-close-tab for web-app profiles.
2026-01-05 14:31:20 -06:00

155 lines
4.8 KiB
Nix

{
pkgs,
myConfig,
inputs,
...
}: {
wayland.windowManager.hyprland.settings = {
exec-once = [
"uwsm app -- pywalfox start"
];
bindd = [
"SUPER, W, Open Browser, exec, uwsm app -- firefox"
"SUPER, Y, Toggle YouTube, togglespecialworkspace, youtube"
"SUPER SHIFT, Y, Move to YouTube Special Workspace, movetoworkspace, special:youtube"
];
workspace = [
"special:youtube, on-created-empty:uwsm app -- firefox -P YouTube --name youtube"
];
windowrulev2 = [
"workspace special:youtube, class:^(youtube)$"
];
};
imports = [
inputs.textfox.homeManagerModules.default
./textfox.nix
];
home.packages = with pkgs; [
pywalfox-native
tridactyl-native
];
home.file.".config/tridactyl/tridactylrc".text = ''
set focusbypass true
set smoothscroll true
bind J tabnext
bind K tabprev
unbind <C-e>
'';
programs.firefox = {
enable = true;
languagePacks = ["en-US"];
nativeMessagingHosts = [
pkgs.pywalfox-native
pkgs.tridactyl-native
];
profiles = {
youtube = import ./profiles/web-app.nix {
inherit pkgs myConfig;
id = 1;
name = "YouTube";
url = "https://youtube.com";
};
hakase = {
search.force = true;
isDefault = true;
search.default = "ddg";
extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [
ublock-origin
bitwarden
tridactyl
];
bookmarks = {
force = true;
settings = [
{
name = "Toolbar Bookmarks";
toolbar = true;
bookmarks = myConfig.firefox.bookmarks;
}
];
};
settings = {
# --- Privacy & Hardening ---
"browser.contentblocking.category" = "strict";
"geo.enabled" = false;
"media.peerconnection.enabled" = false; # Prevents WebRTC IP leaks
"network.dns.disablePrefetch" = true;
"network.prefetch-next" = false;
"privacy.resistFingerprinting" = true; # Note: Spoofs timezone and caps FPS to 60
"privacy.trackingprotection.enabled" = true;
# --- NixOS / Hyprland Integration ---
"widget.use-xdg-desktop-portal.file-picker" = 1; # Use native file picker
# --- UI & Behavior ---
"accessibility.typeaheadfind" = false;
"browser.compactmode.show" = true;
"browser.formfill.enable" = false;
"browser.newtabpage.activity-stream.feeds.section.topstories" = false;
"browser.newtabpage.activity-stream.feeds.snippets" = false;
"browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = false;
"browser.newtabpage.activity-stream.section.highlights.includeDownloads" = false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false;
"browser.newtabpage.activity-stream.section.highlights.includeVisited" = false;
"browser.newtabpage.activity-stream.showSponsored" = false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
"browser.newtabpage.activity-stream.system.showSponsored" = false;
"browser.search.suggest.enabled" = false;
"browser.search.suggest.enabled.private" = false;
"browser.tabs.closeWindowWithLastTab" = false;
"browser.topsites.contile.enabled" = false;
"browser.urlbar.showSearchSuggestionsFirst" = false;
"browser.urlbar.suggest.searches" = false;
"extensions.pocket.enabled" = false;
"extensions.screenshots.disabled" = true;
# --- Homepage & Navigation ---
"browser.newtabpage.pinned" = myConfig.firefox.newtabpage;
"browser.startup.homepage" = "https://dash.sakamoto.dev";
# --- DNS over HTTPS (Quad9) ---
"network.trr.mode" = 2; # Use DoH with system fallback
"network.trr.uri" = "https://dns.quad9.net/dns-query";
};
};
};
policies = {
DisableTelemetry = true;
DisableFirefoxStudies = true;
EnableTrackingProtection = {
Value = true;
Locked = false;
Cryptomining = true;
Fingerprinting = true;
};
DisablePocket = true;
DisableFirefoxAccounts = true;
DisableAccounts = true;
DisableFirefoxScreenshots = true;
OverrideFirstRunPage = "";
OverridePostUpdatePage = "";
DontCheckDefaultBrowser = true;
DisplayBookmarksToolbar = "always";
SearchBar = "unified";
# Power User Messaging
UserMessaging = {
ExtensionRecommendations = false;
SkipOnboarding = true;
FeatureRecommendations = false;
UrlbarInterventions = false;
WhatsNew = false;
};
};
};
}