nixos-config/user/firefox.nix

116 lines
3.5 KiB
Nix
Raw Normal View History

{
config,
pkgs,
lib,
font,
...
}:
let
2024-06-05 01:18:48 -03:00
inherit (config.my) desktop browser;
2024-03-23 12:41:45 -03:00
in
{
2022-10-18 22:41:40 -03:00
config = {
programs.firefox = {
enable = true;
2024-08-20 14:15:46 -03:00
package = pkgs.firefox-devedition;
2022-10-18 22:41:40 -03:00
profiles = {
2024-07-03 12:58:04 -03:00
dev-edition-default = {
2022-10-18 22:41:40 -03:00
isDefault = true;
2024-02-22 21:17:51 -03:00
search.force = true;
2024-02-18 22:10:40 -03:00
search.default = "DuckDuckGo";
2022-10-18 22:41:40 -03:00
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;
2024-06-12 23:36:18 -03:00
"sidebar.position_start" = false; # Move sidebar to the right
2022-10-18 22:41:40 -03:00
# enable media RDD to allow gpu acceleration
"media.rdd-ffmpeg.enabled" = true;
"media.rdd-ffvpx.enabled" = true;
"media.rdd-opus.enabled" = true;
"media.rdd-process.enabled" = true;
"media.rdd-retryonfailure.enabled" = true;
"media.rdd-theora.enabled" = true;
"media.rdd-vorbis.enabled" = true;
"media.rdd-vpx.enabled" = true;
"media.rdd-wav.enabled" = true;
2023-01-11 21:00:30 -03:00
2024-07-15 01:45:44 -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" = true;
2023-01-11 21:00:30 -03:00
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;
"browser.aboutConfig.showWarning" = false;
# Enable userChrome editor (Ctrl+Shift+Alt+I)
"devtools.chrome.enabled" = true;
"devtools.debugger.remote-enabled" = true;
2022-10-18 22:41:40 -03:00
};
2024-08-19 11:51:40 -03:00
userChrome =
if desktop == "sway" then
''
#titlebar { display: none !important; }
#sidebar-header { display: none !important; }
''
else
''
2024-08-20 14:15:58 -03:00
/* Hide tabs and other items */
.toolbar-items {
display: none;
}
2024-08-19 11:51:40 -03:00
2024-08-20 14:15:58 -03:00
/* Make the url bar occupy the entire size of the container */
2024-08-19 11:51:40 -03:00
#nav-bar {
2024-08-20 14:15:58 -03:00
z-index: 1;
2024-08-19 11:51:40 -03:00
padding-right: 29px !important;
}
2024-08-20 14:15:58 -03:00
/* shrink the tab bar to a small size, since it's only the window close button basically */
2024-08-19 11:51:40 -03:00
#titlebar {
2024-09-05 22:13:38 -03:00
position: absolute;
right: 0;
top: 10px;
2024-08-19 11:51:40 -03:00
max-width: 50px;
z-index: 10;
}
2024-08-20 14:15:58 -03:00
/* Add a nice border to the top of the window */
#nav-bar {
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
2024-09-05 22:13:38 -03:00
/* Make the private browser indicator look nice, over the close-window button */
#private-browsing-indicator-with-label {
position: absolute;
top: 4px;
left: 15px;
z-index: 20;
pointer-events: none;
}
#private-browsing-indicator-with-label > label {
display: none;
}
2024-08-19 11:51:40 -03:00
'';
2022-10-18 22:41:40 -03:00
};
};
};
wayland.windowManager.sway = {
extraConfig = ''
exec firefox
'';
2022-12-21 21:01:16 -03:00
};
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
};
}