nixos-config/user/firefox.nix

68 lines
2.1 KiB
Nix
Raw Normal View History

2022-10-18 22:41:40 -03:00
{ config, pkgs, lib, font, ... }:
2022-11-07 11:24:40 -03:00
let inherit (import ./variables.nix) desktop;
2022-10-18 22:41:40 -03:00
in {
config = {
programs.firefox = {
enable = true;
package = pkgs.firefox;
2022-11-10 21:55:46 -03:00
# extensions = with pkgs.nur.repos.rycee.firefox-addons; [
# darkreader
# ublock-origin
# tree-style-tab
# sponsorblock
# duckduckgo-privacy-essentials
# ];
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;
};
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
'';
};
};
};
2022-12-21 21:01:16 -03:00
systemd.user.services = {
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
};
}