Firefox/ru: Difference between revisions
Created page with "<syntaxhighlight lang="nix"> # только если programs.firefox.enable == true programs.firefox.wrapperConfig = { pipewireSupport = true; };" |
Updating to match new version of source page |
||
| Line 1: | Line 1: | ||
<languages/> | |||
{{infobox application | |||
|name=Mozilla Firefox | |||
|image=Firefox logo, 2019.svg | |||
|type=Web Browser | |||
|developer=Mozilla Foundation & Community | |||
|firstRelease=November 9, 2004 | |||
|latestRelease=Firefox 140.0 (June 24, 2025) | |||
|status=Active | |||
|license=[https://www.mozilla.org/MPL/2.0/ Mozilla Public License 2.0] | |||
|os=Cross-platform (Linux, macOS, Windows, *BSD) | |||
|website=[https://www.mozilla.org/firefox mozilla.org/firefox] | |||
|github=mozilla/firefox | |||
|bugTracker=[https://bugzilla.mozilla.org/ Bugzilla] | |||
|documentation=[https://support.mozilla.org/ Official Support] | |||
}} | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
<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. | |||
</div> | </div> | ||
<span id="Installation"></span> | <span id="Installation"></span> | ||
== Установка == | == Установка == | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
==== Shell ==== | |||
</div> | |||
{{code|lang=bash|line=no|1=$ nix-shell -p firefox}} | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
The command above makes <code>firefox</code> available in your current shell without modifying any configuration files. | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
==== System setup ==== | |||
</div> | |||
{{code|lang=nix|line=no|1=# Example for /etc/nixos/configuration.nix | |||
environment.systemPackages = [ | |||
pkgs.firefox | |||
]; | |||
# User-specific installation (in ~/.config/nixpkgs/home.nix) | |||
home.packages = [ | |||
pkgs.firefox | |||
];}} | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
After rebuilding with <code>nixos-rebuild switch</code>, Firefox will be installed system-wide. | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
== Configuration == | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
==== Basic ==== | |||
</div> | </div> | ||
{{code|lang=nix|line=no|1= | |||
programs.firefox = { | |||
enable = true; | |||
languagePacks = [ "en-US" "de" "fr" ]; | |||
preferences = { | |||
"browser.startup.homepage" = "https://example.com"; | |||
"privacy.resistFingerprinting" = true; | |||
}; | |||
policies = { | |||
DisableTelemetry = true; | |||
}; | |||
}; | |||
}} | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
The snippet above enables Firefox for all users (or the current Home Manager profile, if placed in <code>home.nix</code>). | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
==== Advanced ==== | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
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. | |||
</div> | |||
{{code|lang=nix|line=no|1= | |||
programs.firefox = { | |||
enable = true; | |||
languagePacks = [ "en-US" ]; | |||
policies = { | |||
# Updates & Background Services | |||
AppAutoUpdate = false; | |||
BackgroundAppUpdate = false; | |||
# Feature Disabling | |||
DisableBuiltinPDFViewer = true; | |||
DisableFirefoxStudies = true; | |||
DisableFirefoxAccounts = true; | |||
DisableFirefoxScreenshots = true; | |||
DisableForgetButton = true; | |||
DisableMasterPasswordCreation = true; | |||
DisableProfileImport = true; | |||
DisableProfileRefresh = true; | |||
DisableSetDesktopBackground = true; | |||
DisablePocket = true; | |||
DisableTelemetry = true; | |||
DisableFormHistory = true; | |||
DisablePasswordReveal = true; | |||
# Access Restrictions | |||
BlockAboutConfig = false; | |||
BlockAboutProfiles = true; | |||
BlockAboutSupport = true; | |||
# UI and Behavior | |||
DisplayMenuBar = "never"; | |||
DontCheckDefaultBrowser = true; | |||
HardwareAcceleration = false; | |||
OfferToSaveLogins = false; | |||
DefaultDownloadDirectory = "${home}/Downloads"; | |||
# Extensions | |||
ExtensionSettings = let | |||
moz = short: "https://addons.mozilla.org/firefox/downloads/latest/${short}/latest.xpi"; | |||
in { | |||
"*".installation_mode = "blocked"; | |||
"uBlock0@raymondhill.net" = { | |||
install_url = moz "ublock-origin"; | |||
installation_mode = "force_installed"; | |||
updates_disabled = true; | |||
}; | |||
"{f3b4b962-34b4-4935-9eee-45b0bce58279}" = { | |||
install_url = moz "animated-purple-moon-lake"; | |||
installation_mode = "force_installed"; | |||
updates_disabled = true; | |||
}; | |||
"{73a6fe31-595d-460b-a920-fcc0f8843232}" = { | |||
install_url = moz "noscript"; | |||
installation_mode = "force_installed"; | |||
updates_disabled = true; | |||
}; | |||
}; | |||
# Extension configuration | |||
"3rdparty".Extensions = { | |||
"uBlock0@raymondhill.net".adminSettings = { | |||
userSettings = rec { | |||
uiTheme = "dark"; | |||
uiAccentCustom = true; | |||
uiAccentCustom0 = "#8300ff"; | |||
cloudStorageEnabled = mkForce false; | |||
importedLists = [ | |||
"https:#filters.adtidy.org/extension/ublock/filters/3.txt" | |||
"https:#github.com/DandelionSprout/adfilt/raw/master/LegitimateURLShortener.txt" | |||
]; | |||
externalLists = lib.concatStringsSep "\n" importedLists; | |||
}; | |||
selectedFilterLists = [ | |||
"CZE-0" | |||
"adguard-generic" | |||
"adguard-annoyance" | |||
"adguard-social" | |||
"adguard-spyware-url" | |||
"easylist" | |||
"easyprivacy" | |||
"https:#github.com/DandelionSprout/adfilt/raw/master/LegitimateURLShortener.txt" | |||
"plowe-0" | |||
"ublock-abuse" | |||
"ublock-badware" | |||
"ublock-filters" | |||
"ublock-privacy" | |||
"ublock-quick-fixes" | |||
"ublock-unbreak" | |||
"urlhaus-1" | |||
]; | |||
}; | |||
}; | |||
}; | |||
profiles.default.search = { | |||
force = true; | |||
default = "DuckDuckGo"; | |||
privateDefault = "DuckDuckGo"; | |||
engines = { | |||
"Nix Packages" = { | |||
urls = [ | |||
{ | |||
template = "https://search.nixos.org/packages"; | |||
params = [ | |||
{ name = "channel"; value = "unstable"; } | |||
{ name = "query"; value = "{searchTerms}"; } | |||
]; | |||
} | |||
]; | |||
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; | |||
definedAliases = [ "@np" ]; | |||
}; | |||
"Nix Options" = { | |||
urls = [ | |||
{ | |||
template = "https://search.nixos.org/options"; | |||
params = [ | |||
{ name = "channel"; value = "unstable"; } | |||
{ name = "query"; value = "{searchTerms}"; } | |||
]; | |||
} | |||
]; | |||
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; | |||
definedAliases = [ "@no" ]; | |||
}; | |||
"NixOS Wiki" = { | |||
urls = [ | |||
{ | |||
template = "https://wiki.nixos.org/w/index.php"; | |||
params = [ | |||
{ name = "search"; value = "{searchTerms}"; } | |||
]; | |||
} | |||
]; | |||
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; | |||
definedAliases = [ "@nw" ]; | |||
}; | |||
}; | |||
}; | |||
}; | |||
}} | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
[https://nix-community.github.io/home-manager/options.xhtml#opt-programs.firefox.enable More options are available on Home Manager's site.] | |||
</div> | |||
<span id="Firefox_Variants"></span> | <span id="Firefox_Variants"></span> | ||
== Версии Firefox == | == Версии Firefox == | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
There are several Firefox variants | There are several Firefox variants available. To choose one, set the <code>programs.firefox.package</code> option accordingly. | ||
</div> | </div> | ||
{{Note|<span lang="en" dir="ltr" class="mw-content-ltr">The packages for the variants listed below are installed ''instead'' of the normal <code>firefox</code> package.</span>}} | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
=== Variant: Official Binaries === | === Variant: Official Binaries === | ||
</div> | </div> | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
Mozilla provides official pre-built Firefox binaries | Mozilla provides official pre-built Firefox binaries via the <code>firefox-bin</code> package, which are downloaded directly from Mozilla's servers. | ||
</div> | </div> | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
=== Variant: ESR === | === Variant: Extended Support Release (ESR) === | ||
</div> | </div> | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
<code>firefox-esr</code> is | <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. | ||
</div> | </div> | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
=== Variant: Nightly === | === Variant: Nightly === | ||
</div> | </div> | ||
<div class="mw-translate-fuzzy"> | |||
Nightly builds - это ежедневные сборки Firefox из центрального репозитория Mozilla. | Nightly builds - это ежедневные сборки Firefox из центрального репозитория Mozilla. | ||
</div> | </div> | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
==== Method 1: Using nix-community/flake-firefox-nightly ==== | |||
</div> | </div> | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
First, add the | This method is reproducible but may lag behind the upstream version. First, add the input to your flake: | ||
</div> | </div> | ||
{{code|lang=nix|line=no|1= | |||
inputs = { | inputs = { | ||
firefox.url = "github:nix-community/flake-firefox-nightly"; | firefox.url = "github:nix-community/flake-firefox-nightly"; | ||
firefox.inputs.nixpkgs.follows = "nixpkgs"; | firefox.inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | }; | ||
}} | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
Then | Then, add the package to your system: | ||
</div> | </div> | ||
{{code|lang=nix|line=no|1= | |||
# In configuration.nix, assuming use of specialArgs | |||
environment.systemPackages = [ | |||
inputs.firefox.packages.${pkgs.stdenv.hostPlatform.system}.firefox-nightly-bin | |||
]; | |||
} | }} | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
==== Method 2: Using mozilla/nixpkgs-mozilla ==== | |||
</div> | </div> | ||
<div class="mw-translate-fuzzy"> | |||
Использование этого метода плохо сказывается на воспроизводимости, так как ресурсы берутся с URL-адресов, не относящихся к привязке, но это также означает, что вы всегда получаете последнюю Nightly версию, когда собираете свою систему. | |||
</div> | |||
{{code|lang=nix|line=no|1= | |||
nixpkgs.overlays = [ | |||
(import (builtins.fetchTarball "https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz")) | |||
]; | |||
programs.firefox.package = pkgs.latest.firefox-nightly-bin; | |||
}} | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
Using this method requires the <code>--impure</code> flag for Nix commands, for example: | |||
</div> | </div> | ||
< | {{code|lang=bash|line=no|1=$ nixos-rebuild switch --impure}} | ||
<span id="Tips_and_Tricks"></span> | |||
<div class="mw-translate-fuzzy"> | |||
== Советы == | |||
</div> | </div> | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
==== Force XWayland (X11) instead of Wayland ==== | |||
</div> | </div> | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
Firefox defaults to native Wayland when running under a Wayland compositor. To force it to use XWayland (X11) instead: | |||
</div> | </div> | ||
{{code|lang=nix|line=no|1=environment.sessionVariables.MOZ_ENABLE_WAYLAND = "0";}} | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
This is useful when troubleshooting Wayland-specific issues or when certain features work better under X11. | |||
</div> | </div> | ||
< | |||
<span id="Touchpad_Gestures_and_Smooth_Scrolling"></span> | |||
<div class="mw-translate-fuzzy"> | |||
=== Использовать Xinput2 === | |||
</div> | </div> | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
Enable <code>xinput2</code> to improve touchscreen support and enable additional touchpad gestures and smooth scrolling. | |||
</div> | </div> | ||
{{code|lang=nix|line=no|1= | |||
environment.sessionVariables.MOZ_USE_XINPUT2 = "1"; | |||
}} | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
=== | ==== KDE Plasma Integration ==== | ||
</div> | </div> | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
1. Add the | 1. Add the native messaging host package to your configuration: | ||
</div> | </div> | ||
{{code|lang=nix|line=no|1=programs.firefox.nativeMessagingHosts.packages = [ pkgs.kdePackages.plasma-browser-integration ];}} | |||
programs.firefox.nativeMessagingHosts.packages = [ pkgs. | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
2. Install [https://addons.mozilla.org/en-US/firefox/addon/plasma-integration/ | 2. Install the corresponding [https://addons.mozilla.org/en-US/firefox/addon/plasma-integration/ browser add-on]. | ||
</div> | </div> | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
=== Use KDE file picker === | ==== Use KDE file picker ==== | ||
</div> | </div> | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
To use the KDE file picker instead of the GTK one, set the following preference: | |||
</div> | </div> | ||
{{code|lang=nix|line=no|1= | |||
programs.firefox.preferences = { | |||
"widget.use-xdg-desktop-portal.file-picker" = 1; | |||
}; | }; | ||
}} | |||
<span id="Troubleshooting"></span> | <span id="Troubleshooting"></span> | ||
<div class="mw-translate-fuzzy"> | |||
== Устранение неполадок == | == Устранение неполадок == | ||
</div> | |||
</div> | |||
<span id="Native_Messaging_Hosts_Fail_to_Load"></span> | |||
< | <div class="mw-translate-fuzzy"> | ||
<div | |||
=== <code>nativeMessagingHosts</code> не работает === | === <code>nativeMessagingHosts</code> не работает === | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
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. | |||
</div> | |||
<span id="ALSA_audio_instead_of_PulseAudio"></span> | |||
<div class="mw-translate-fuzzy"> | |||
=== Как использовать ALSA в Firefox вместо PulseAudio? === | |||
</div> | </div> | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
To force Firefox to use ALSA, you can override it with a wrapper: | |||
</div> | </div> | ||
{{code|lang=nix|line=no|1=programs.firefox.package = pkgs.wrapFirefox pkgs.firefox-unwrapped { libpulseaudio = pkgs.libalsa; };}} | |||
<span id="Screen_Sharing_under_Wayland"></span> | <span id="Screen_Sharing_under_Wayland"></span> | ||
<div class="mw-translate-fuzzy"> | |||
=== Поделиться Экраном через Wayland === | === Поделиться Экраном через Wayland === | ||
</div> | </div> | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
Screen sharing on Wayland requires enabling PipeWire and the appropriate XDG Desktop Portals. | |||
</div> | </div> | ||
{{code|lang=nix|line=no|1= | |||
services.pipewire.enable = true; | services.pipewire.enable = true; | ||
xdg.portal = { | |||
enable = true; | |||
# Add the portal for your compositor, e.g.: | |||
extraPortals = with pkgs; [ | |||
xdg-desktop-portal-wlr # For Sway/wlroots | |||
# xdg-desktop-portal-gtk # For GNOME | |||
# xdg-desktop-portal-kde # For KDE | |||
]; | |||
}; | }; | ||
}} | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
== See also == | |||
</div> | </div> | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
* [[Home Manager]] – Declarative per-user configuration | |||
* [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] | |||
</div> | </div> | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
== References == | |||
</div> | </div> | ||
[[Category:Applications]] | [[Category:Applications]] | ||
[[Category:Web Browser]] | |||
Latest revision as of 19:39, 7 March 2026
Firefox[1] 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.
Установка
Shell
$ nix-shell -p firefox
The command above makes firefox available in your current shell without modifying any configuration files.
System setup
# Example for /etc/nixos/configuration.nix
environment.systemPackages = [
pkgs.firefox
];
# User-specific installation (in ~/.config/nixpkgs/home.nix)
home.packages = [
pkgs.firefox
];
After rebuilding with nixos-rebuild switch, Firefox will be installed system-wide.
Configuration
Basic
programs.firefox = {
enable = true;
languagePacks = [ "en-US" "de" "fr" ];
preferences = {
"browser.startup.homepage" = "https://example.com";
"privacy.resistFingerprinting" = true;
};
policies = {
DisableTelemetry = true;
};
};
The snippet above enables Firefox for all users (or the current Home Manager profile, if placed in home.nix).
Advanced
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.
programs.firefox = {
enable = true;
languagePacks = [ "en-US" ];
policies = {
# Updates & Background Services
AppAutoUpdate = false;
BackgroundAppUpdate = false;
# Feature Disabling
DisableBuiltinPDFViewer = true;
DisableFirefoxStudies = true;
DisableFirefoxAccounts = true;
DisableFirefoxScreenshots = true;
DisableForgetButton = true;
DisableMasterPasswordCreation = true;
DisableProfileImport = true;
DisableProfileRefresh = true;
DisableSetDesktopBackground = true;
DisablePocket = true;
DisableTelemetry = true;
DisableFormHistory = true;
DisablePasswordReveal = true;
# Access Restrictions
BlockAboutConfig = false;
BlockAboutProfiles = true;
BlockAboutSupport = true;
# UI and Behavior
DisplayMenuBar = "never";
DontCheckDefaultBrowser = true;
HardwareAcceleration = false;
OfferToSaveLogins = false;
DefaultDownloadDirectory = "${home}/Downloads";
# Extensions
ExtensionSettings = let
moz = short: "https://addons.mozilla.org/firefox/downloads/latest/${short}/latest.xpi";
in {
"*".installation_mode = "blocked";
"uBlock0@raymondhill.net" = {
install_url = moz "ublock-origin";
installation_mode = "force_installed";
updates_disabled = true;
};
"{f3b4b962-34b4-4935-9eee-45b0bce58279}" = {
install_url = moz "animated-purple-moon-lake";
installation_mode = "force_installed";
updates_disabled = true;
};
"{73a6fe31-595d-460b-a920-fcc0f8843232}" = {
install_url = moz "noscript";
installation_mode = "force_installed";
updates_disabled = true;
};
};
# Extension configuration
"3rdparty".Extensions = {
"uBlock0@raymondhill.net".adminSettings = {
userSettings = rec {
uiTheme = "dark";
uiAccentCustom = true;
uiAccentCustom0 = "#8300ff";
cloudStorageEnabled = mkForce false;
importedLists = [
"https:#filters.adtidy.org/extension/ublock/filters/3.txt"
"https:#github.com/DandelionSprout/adfilt/raw/master/LegitimateURLShortener.txt"
];
externalLists = lib.concatStringsSep "\n" importedLists;
};
selectedFilterLists = [
"CZE-0"
"adguard-generic"
"adguard-annoyance"
"adguard-social"
"adguard-spyware-url"
"easylist"
"easyprivacy"
"https:#github.com/DandelionSprout/adfilt/raw/master/LegitimateURLShortener.txt"
"plowe-0"
"ublock-abuse"
"ublock-badware"
"ublock-filters"
"ublock-privacy"
"ublock-quick-fixes"
"ublock-unbreak"
"urlhaus-1"
];
};
};
};
profiles.default.search = {
force = true;
default = "DuckDuckGo";
privateDefault = "DuckDuckGo";
engines = {
"Nix Packages" = {
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{ name = "channel"; value = "unstable"; }
{ name = "query"; value = "{searchTerms}"; }
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"Nix Options" = {
urls = [
{
template = "https://search.nixos.org/options";
params = [
{ name = "channel"; value = "unstable"; }
{ name = "query"; value = "{searchTerms}"; }
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"NixOS Wiki" = {
urls = [
{
template = "https://wiki.nixos.org/w/index.php";
params = [
{ name = "search"; value = "{searchTerms}"; }
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@nw" ];
};
};
};
};
Версии Firefox
There are several Firefox variants available. To choose one, set the programs.firefox.package option accordingly.
Variant: Official Binaries
Mozilla provides official pre-built Firefox binaries via the firefox-bin package, which are downloaded directly from Mozilla's servers.
Variant: Extended Support Release (ESR)
firefox-esr 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
Nightly builds - это ежедневные сборки Firefox из центрального репозитория Mozilla.
Method 1: Using nix-community/flake-firefox-nightly
This method is reproducible but may lag behind the upstream version. First, add the input to your flake:
inputs = {
firefox.url = "github:nix-community/flake-firefox-nightly";
firefox.inputs.nixpkgs.follows = "nixpkgs";
};
Then, add the package to your system:
# In configuration.nix, assuming use of specialArgs
environment.systemPackages = [
inputs.firefox.packages.${pkgs.stdenv.hostPlatform.system}.firefox-nightly-bin
];
Method 2: Using mozilla/nixpkgs-mozilla
Использование этого метода плохо сказывается на воспроизводимости, так как ресурсы берутся с URL-адресов, не относящихся к привязке, но это также означает, что вы всегда получаете последнюю Nightly версию, когда собираете свою систему.
nixpkgs.overlays = [
(import (builtins.fetchTarball "https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz"))
];
programs.firefox.package = pkgs.latest.firefox-nightly-bin;
Using this method requires the --impure flag for Nix commands, for example:
$ nixos-rebuild switch --impure
Советы
Force XWayland (X11) instead of Wayland
Firefox defaults to native Wayland when running under a Wayland compositor. To force it to use XWayland (X11) instead:
environment.sessionVariables.MOZ_ENABLE_WAYLAND = "0";
This is useful when troubleshooting Wayland-specific issues or when certain features work better under X11.
Использовать Xinput2
Enable xinput2 to improve touchscreen support and enable additional touchpad gestures and smooth scrolling.
environment.sessionVariables.MOZ_USE_XINPUT2 = "1";
KDE Plasma Integration
1. Add the native messaging host package to your configuration:
programs.firefox.nativeMessagingHosts.packages = [ pkgs.kdePackages.plasma-browser-integration ];
2. Install the corresponding browser add-on.
Use KDE file picker
To use the KDE file picker instead of the GTK one, set the following preference:
programs.firefox.preferences = {
"widget.use-xdg-desktop-portal.file-picker" = 1;
};
Устранение неполадок
nativeMessagingHosts не работает
Native messaging hosts (used for extensions like Plasma Integration) do not work with the -bin variants of Firefox or with Firefox installed imperatively via nix-env. You must use a variant built from source via your NixOS or Home Manager configuration.
Как использовать ALSA в Firefox вместо PulseAudio?
To force Firefox to use ALSA, you can override it with a wrapper:
programs.firefox.package = pkgs.wrapFirefox pkgs.firefox-unwrapped { libpulseaudio = pkgs.libalsa; };
Поделиться Экраном через Wayland
Screen sharing on Wayland requires enabling PipeWire and the appropriate XDG Desktop Portals.
services.pipewire.enable = true;
xdg.portal = {
enable = true;
# Add the portal for your compositor, e.g.:
extraPortals = with pkgs; [
xdg-desktop-portal-wlr # For Sway/wlroots
# xdg-desktop-portal-gtk # For GNOME
# xdg-desktop-portal-kde # For KDE
];
};
See also
- Home Manager – Declarative per-user configuration
- NixOS options for Firefox
- Firefox topics on NixOS Discourse
References
- ↑ Mozilla Foundation, "Firefox", Official Website, Accessed June 2025. https://www.mozilla.org/firefox