2022-10-18 22:41:40 -03:00
|
|
|
{ config, pkgs, lib, font, ... }:
|
2023-01-23 00:35:40 -03:00
|
|
|
let inherit (pkgs.uservars) desktop browser;
|
2022-10-18 22:41:40 -03:00
|
|
|
in {
|
|
|
|
config = {
|
|
|
|
programs.firefox = {
|
|
|
|
enable = true;
|
2023-04-17 22:51:15 -03:00
|
|
|
package = pkgs.firefox-esr;
|
2023-04-17 22:37:20 -03:00
|
|
|
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
|
|
|
|
darkreader
|
|
|
|
duckduckgo-privacy-essentials
|
|
|
|
sponsorblock
|
|
|
|
tree-style-tab
|
|
|
|
ublock-origin
|
|
|
|
ublock-origin
|
|
|
|
];
|
2022-10-18 22:41:40 -03:00
|
|
|
profiles = {
|
|
|
|
main = {
|
|
|
|
isDefault = true;
|
|
|
|
settings = {
|
2022-11-07 11:24:40 -03:00
|
|
|
"devtools.theme" = "auto";
|
2022-10-18 22:41:40 -03:00
|
|
|
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
2022-11-07 11:24:40 -03:00
|
|
|
"browser.tabs.inTitlebar" = if desktop == "sway" then 0 else 1;
|
2022-10-18 22:41:40 -03:00
|
|
|
|
2023-01-11 21:00:30 -03:00
|
|
|
# disable media RDD because it's buggy and crashes the gpu
|
|
|
|
"media.rdd-ffmpeg.enabled" = false;
|
|
|
|
"media.rdd-ffvpx.enabled" = false;
|
|
|
|
"media.rdd-opus.enabled" = false;
|
|
|
|
"media.rdd-process.enabled" = false;
|
|
|
|
"media.rdd-retryonfailure.enabled" = false;
|
|
|
|
"media.rdd-theora.enabled" = false;
|
|
|
|
"media.rdd-vorbis.enabled" = false;
|
|
|
|
"media.rdd-vpx.enabled" = false;
|
|
|
|
"media.rdd-wav.enabled" = false;
|
|
|
|
|
2022-11-07 11:24:40 -03:00
|
|
|
"media.av1.enabled" = true;
|
2023-01-11 21:00:30 -03:00
|
|
|
"media.ffmpeg.vaapi-drm-display.enabled" = true;
|
|
|
|
"media.ffmpeg.vaapi.enabled" = true;
|
|
|
|
"media.ffvpx.enabled" = false;
|
|
|
|
|
2022-10-18 22:41:40 -03:00
|
|
|
"gfx.webrender.all" = true;
|
2023-04-24 17:56:35 -03:00
|
|
|
|
|
|
|
# Enable installing non signed extensions
|
|
|
|
"extensions.langpacks.signatures.required" = false;
|
|
|
|
"xpinstall.signatures.required" = false;
|
2022-10-18 22:41:40 -03:00
|
|
|
};
|
2022-11-07 11:24:40 -03:00
|
|
|
userChrome = lib.mkIf (desktop == "sway") ''
|
2022-10-22 23:54:02 -03:00
|
|
|
#titlebar { display: none !important; }
|
2022-10-18 22:41:40 -03:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-01-22 00:10:08 -03:00
|
|
|
systemd.user.services = lib.mkIf (browser == "firefox") {
|
2022-12-21 21:01:16 -03:00
|
|
|
firefox = {
|
|
|
|
Unit = {
|
|
|
|
Description = "Firefox Web client";
|
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
After = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
Service = {
|
2022-12-24 10:27:07 -03:00
|
|
|
ExecStartPre = "/usr/bin/env sleep 10s";
|
2022-12-21 21:01:16 -03:00
|
|
|
ExecStart = "${pkgs.firefox}/bin/firefox";
|
|
|
|
Restart = "on-failure";
|
|
|
|
};
|
|
|
|
Install = { WantedBy = [ "sway-session.target" ]; };
|
|
|
|
};
|
|
|
|
};
|
2023-01-11 21:00:30 -03:00
|
|
|
home.sessionVariables = {
|
|
|
|
MOZ_ENABLE_WAYLAND = "1";
|
|
|
|
MOZ_DISABLE_RDD_SANDBOX = "1";
|
|
|
|
};
|
2022-10-18 22:41:40 -03:00
|
|
|
};
|
|
|
|
}
|