Firefox: Difference between revisions
m Fix location of "3rdparty" policies |
Marked this version for translation |
||
| (One intermediate revision by the same user not shown) | |||
| Line 19: | Line 19: | ||
<strong>Firefox</strong><ref>Mozilla Foundation, "Firefox", Official Website, Accessed June 2025. https://www.mozilla.org/firefox</ref> is a free and open-source web browser developed by the Mozilla Foundation. It is known for its focus on privacy, security, and user freedom, offering a customizable experience through a rich ecosystem of add-ons and themes. | <strong>Firefox</strong><ref>Mozilla Foundation, "Firefox", Official Website, Accessed June 2025. https://www.mozilla.org/firefox</ref> is a free and open-source web browser developed by the Mozilla Foundation. It is known for its focus on privacy, security, and user freedom, offering a customizable experience through a rich ecosystem of add-ons and themes. | ||
== Installation == <!--T: | == Installation == <!--T:2--> | ||
==== Shell ==== <!--T: | ==== Shell ==== <!--T:56--> | ||
</translate> | </translate> | ||
{{code|lang=bash|line=no|1=$ nix-shell -p firefox}} | {{code|lang=bash|line=no|1=$ nix-shell -p firefox}} | ||
<translate> | <translate> | ||
<!--T: | <!--T:57--> | ||
The command above makes <code>firefox</code> available in your current shell without modifying any configuration files. | The command above makes <code>firefox</code> available in your current shell without modifying any configuration files. | ||
==== System setup ==== <!--T: | ==== System setup ==== <!--T:58--> | ||
</translate> | </translate> | ||
{{code|lang=nix|line=no|1=# Example for /etc/nixos/configuration.nix | {{code|lang=nix|line=no|1=# Example for /etc/nixos/configuration.nix | ||
environment.systemPackages = [ | environment.systemPackages = [ | ||
| Line 40: | Line 43: | ||
];}} | ];}} | ||
<translate> | <translate> | ||
<!--T: | <!--T:59--> | ||
After rebuilding with <code>nixos-rebuild switch</code>, Firefox will be installed system-wide. | After rebuilding with <code>nixos-rebuild switch</code>, Firefox will be installed system-wide. | ||
== Configuration == <!--T: | == Configuration == <!--T:60--> | ||
==== Basic ==== <!--T: | ==== Basic ==== <!--T:61--> | ||
</translate> | </translate> | ||
{{code|lang=nix|line=no|1= | {{code|lang=nix|line=no|1= | ||
programs.firefox = { | programs.firefox = { | ||
| Line 63: | Line 67: | ||
}; | }; | ||
}} | }} | ||
<translate> | <translate> | ||
<!--T: | <!--T:3--> | ||
The snippet above enables Firefox for all users (or the current Home Manager profile, if placed in <code>home.nix</code>). | The snippet above enables Firefox for all users (or the current Home Manager profile, if placed in <code>home.nix</code>). | ||
==== Advanced ==== <!--T: | ==== Advanced ==== <!--T:23--> | ||
<!--T:24--> | |||
<!--T: | |||
Home Manager allows for deep customization of Firefox, including extensions, search engines, bookmarks, and themes. The example below shows a configuration for adding custom search engines with aliases. | Home Manager allows for deep customization of Firefox, including extensions, search engines, bookmarks, and themes. The example below shows a configuration for adding custom search engines with aliases. | ||
</translate> | </translate> | ||
{{code|lang=nix|line=no|1= | {{code|lang=nix|line=no|1= | ||
programs.firefox = { | programs.firefox = { | ||
| Line 225: | Line 230: | ||
}; | }; | ||
}} | }} | ||
<translate> | <translate> | ||
<!--T: | <!--T:25--> | ||
[https://nix-community.github.io/home-manager/options.xhtml#opt-programs.firefox.enable More options are available on Home Manager's site.] | [https://nix-community.github.io/home-manager/options.xhtml#opt-programs.firefox.enable More options are available on Home Manager's site.] | ||
< | == Firefox Variants == <!--T:4--> | ||
<!--T:5--> | |||
There are several Firefox variants available. To choose one, set the <code>programs.firefox.package</code> option accordingly. | There are several Firefox variants available. To choose one, set the <code>programs.firefox.package</code> option accordingly. | ||
</translate> | </translate> | ||
{{Note|The packages for the variants listed below are installed ''instead'' of the normal <code>firefox</code> package.}} | |||
{{Note|<translate><!--T:6--> The packages for the variants listed below are installed ''instead'' of the normal <code>firefox</code> package.</translate>}} | |||
<translate> | <translate> | ||
=== Variant: Official Binaries === <!--T: | === Variant: Official Binaries === <!--T:7--> | ||
<!--T:8--> | |||
<!--T: | |||
Mozilla provides official pre-built Firefox binaries via the <code>firefox-bin</code> package, which are downloaded directly from Mozilla's servers. | Mozilla provides official pre-built Firefox binaries via the <code>firefox-bin</code> package, which are downloaded directly from Mozilla's servers. | ||
=== Variant: Extended Support Release (ESR) === <!--T:9--> | |||
=== Variant: Extended Support Release (ESR) === <!--T: | |||
<!--T:10--> | |||
<!--T: | |||
<code>firefox-esr</code> is a variant that receives security updates for a longer period with a slower feature implementation cadence. It also allows for more extensive policy-based configuration. | <code>firefox-esr</code> is a variant that receives security updates for a longer period with a slower feature implementation cadence. It also allows for more extensive policy-based configuration. | ||
=== Variant: Nightly === <!--T:11--> | |||
=== Variant: Nightly === <!--T: | |||
<!--T:12--> | |||
<!--T: | |||
Nightly builds are daily builds from the central Mozilla repository. | Nightly builds are daily builds from the central Mozilla repository. | ||
==== Method 1: Using nix-community/flake-firefox-nightly ==== <!--T:13--> | |||
==== Method 1: Using nix-community/flake-firefox-nightly ==== <!--T: | |||
<!--T:14--> | |||
<!--T: | |||
This method is reproducible but may lag behind the upstream version. First, add the input to your flake: | This method is reproducible but may lag behind the upstream version. First, add the input to your flake: | ||
</translate> | </translate> | ||
{{code|lang=nix|line=no|1= | {{code|lang=nix|line=no|1= | ||
inputs = { | inputs = { | ||
| Line 273: | Line 271: | ||
}; | }; | ||
}} | }} | ||
<translate> | <translate> | ||
<!--T: | <!--T:16--> | ||
Then, add the package to your system: | Then, add the package to your system: | ||
</translate> | </translate> | ||
{{code|lang=nix|line=no|1= | {{code|lang=nix|line=no|1= | ||
# In configuration.nix, assuming use of specialArgs | # In configuration.nix, assuming use of specialArgs | ||
| Line 283: | Line 283: | ||
]; | ]; | ||
}} | }} | ||
<translate> | <translate> | ||
==== Method 2: Using mozilla/nixpkgs-mozilla ==== <!--T: | ==== Method 2: Using mozilla/nixpkgs-mozilla ==== <!--T:18--> | ||
<!--T:19--> | |||
<!--T: | |||
This method is not necessarily reproducible without a flake-like system but will always be the latest version. | This method is not necessarily reproducible without a flake-like system but will always be the latest version. | ||
</translate> | </translate> | ||
{{code|lang=nix|line=no|1= | {{code|lang=nix|line=no|1= | ||
nixpkgs.overlays = [ | nixpkgs.overlays = [ | ||
| Line 296: | Line 297: | ||
programs.firefox.package = pkgs.latest.firefox-nightly-bin; | programs.firefox.package = pkgs.latest.firefox-nightly-bin; | ||
}} | }} | ||
<translate> | <translate> | ||
<!--T: | <!--T:22--> | ||
Using this method requires the <code>--impure</code> flag for Nix commands, for example: | Using this method requires the <code>--impure</code> flag for Nix commands, for example: | ||
</translate> | </translate> | ||
{{code|lang=bash|line=no|1=$ nixos-rebuild switch --impure}} | {{code|lang=bash|line=no|1=$ nixos-rebuild switch --impure}} | ||
<translate> | <translate> | ||
== Tips and Tricks == <!--T: | == Tips and Tricks == <!--T:28--> | ||
==== Force XWayland (X11) instead of Wayland ==== <!--T:62--> | |||
<!--T:63--> | |||
Firefox defaults to native Wayland when running under a Wayland compositor. To force it to use XWayland (X11) instead: | Firefox defaults to native Wayland when running under a Wayland compositor. To force it to use XWayland (X11) instead: | ||
</translate> | </translate> | ||
{{code|lang=nix|line=no|1=environment.sessionVariables.MOZ_ENABLE_WAYLAND = "0";}} | {{code|lang=nix|line=no|1=environment.sessionVariables.MOZ_ENABLE_WAYLAND = "0";}} | ||
<translate> | <translate> | ||
<!--T:30a--> | <!--T:30a--> | ||
This is useful when troubleshooting Wayland-specific issues or when certain features work better under X11. | This is useful when troubleshooting Wayland-specific issues or when certain features work better under X11. | ||
==== Touchpad Gestures and Smooth Scrolling ==== <!--T:34--> | |||
==== Touchpad Gestures and Smooth Scrolling ==== <!--T: | |||
<!--T:35--> | |||
<!--T: | |||
Enable <code>xinput2</code> to improve touchscreen support and enable additional touchpad gestures and smooth scrolling. | Enable <code>xinput2</code> to improve touchscreen support and enable additional touchpad gestures and smooth scrolling. | ||
</translate> | </translate> | ||
{{code|lang=nix|line=no|1= | {{code|lang=nix|line=no|1= | ||
environment.sessionVariables.MOZ_USE_XINPUT2 = "1"; | environment.sessionVariables.MOZ_USE_XINPUT2 = "1"; | ||
}} | }} | ||
<translate> | <translate> | ||
==== KDE Plasma Integration ==== <!--T: | ==== KDE Plasma Integration ==== <!--T:29--> | ||
<!--T:30--> | |||
<!--T: | |||
1. Add the native messaging host package to your configuration: | 1. Add the native messaging host package to your configuration: | ||
</translate> | </translate> | ||
{{code|lang=nix|line=no|1=programs.firefox.nativeMessagingHosts.packages = [ pkgs.kdePackages.plasma-browser-integration ];}} | {{code|lang=nix|line=no|1=programs.firefox.nativeMessagingHosts.packages = [ pkgs.kdePackages.plasma-browser-integration ];}} | ||
<translate> | <translate> | ||
<!--T: | <!--T:31--> | ||
2. Install the corresponding [https://addons.mozilla.org/en-US/firefox/addon/plasma-integration/ browser add-on]. | 2. Install the corresponding [https://addons.mozilla.org/en-US/firefox/addon/plasma-integration/ browser add-on]. | ||
==== Use KDE file picker ==== <!--T:32--> | |||
==== Use KDE file picker ==== <!--T: | |||
<!--T:33--> | |||
<!--T: | |||
To use the KDE file picker instead of the GTK one, set the following preference: | To use the KDE file picker instead of the GTK one, set the following preference: | ||
</translate> | </translate> | ||
{{code|lang=nix|line=no|1= | {{code|lang=nix|line=no|1= | ||
programs.firefox.preferences = { | programs.firefox.preferences = { | ||
| Line 352: | Line 356: | ||
<translate> | <translate> | ||
== Troubleshooting == <!--T: | == Troubleshooting == <!--T:36--> | ||
==== Native Messaging Hosts Fail to Load ==== <!--T:40--> | |||
==== Native Messaging Hosts Fail to Load ==== <!--T: | |||
<!--T:42--> | |||
<!--T: | |||
Native messaging hosts (used for extensions like Plasma Integration) do not work with the <code>-bin</code> variants of Firefox or with Firefox installed imperatively via <code>nix-env</code>. You must use a variant built from source via your NixOS or Home Manager configuration. | Native messaging hosts (used for extensions like Plasma Integration) do not work with the <code>-bin</code> variants of Firefox or with Firefox installed imperatively via <code>nix-env</code>. You must use a variant built from source via your NixOS or Home Manager configuration. | ||
==== ALSA audio instead of PulseAudio ==== <!--T:27--> | |||
==== ALSA audio instead of PulseAudio ==== <!--T: | |||
<!--T:64--> | |||
<!--T: | |||
To force Firefox to use ALSA, you can override it with a wrapper: | To force Firefox to use ALSA, you can override it with a wrapper: | ||
</translate> | </translate> | ||
{{code|lang=nix|line=no|1=programs.firefox.package = pkgs.wrapFirefox pkgs.firefox-unwrapped { libpulseaudio = pkgs.libalsa; };}} | {{code|lang=nix|line=no|1=programs.firefox.package = pkgs.wrapFirefox pkgs.firefox-unwrapped { libpulseaudio = pkgs.libalsa; };}} | ||
<translate> | <translate> | ||
==== Screen Sharing under Wayland ==== <!--T:43--> | ==== Screen Sharing under Wayland ==== <!--T:43--> | ||
<!--T:44--> | <!--T:44--> | ||
Screen sharing on Wayland requires enabling PipeWire and the appropriate XDG Desktop Portals. | Screen sharing on Wayland requires enabling PipeWire and the appropriate XDG Desktop Portals. | ||
</translate> | </translate> | ||
{{code|lang=nix|line=no|1= | {{code|lang=nix|line=no|1= | ||
services.pipewire.enable = true; | services.pipewire.enable = true; | ||
| Line 390: | Line 392: | ||
<translate> | <translate> | ||
== See also == <!--T: | == See also == <!--T:65--> | ||
< | <!--T:66--> | ||
* [[Home Manager]] – Declarative per-user configuration | * [[Home Manager]] – Declarative per-user configuration | ||
* [https://search.nixos.org/options?channel=unstable&query=programs.firefox NixOS options for Firefox] | * [https://search.nixos.org/options?channel=unstable&query=programs.firefox NixOS options for Firefox] | ||
* [https://discourse.nixos.org/tag/firefox Firefox topics on NixOS Discourse] | * [https://discourse.nixos.org/tag/firefox Firefox topics on NixOS Discourse] | ||
== References == <!--T:67--> | |||
== References == <!--T: | |||
</translate> | </translate> | ||
[[Category:Applications]] | [[Category:Applications]] | ||
[[Category:Web Browser]] | [[Category:Web Browser]] | ||