firefox: deprecate 'enableGnomeExtensions'

Fixes #1990.
This commit is contained in:
Bruno BELANYI 2021-05-14 21:06:54 +02:00 committed by Robert Helgesson
parent cced902dda
commit b449cb77b1
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
3 changed files with 52 additions and 0 deletions

View file

@ -86,6 +86,17 @@ in
then pkgs.firefox
else pkgs.firefox-unwrapped;
defaultText = literalExample "pkgs.firefox";
example = literalExample ''
pkgs.firefox.override {
# See nixpkgs' firefox/wrapper.nix to check which options you can use
cfg = {
# Gnome shell native connector
enableGnomeExtensions = true;
# Tridactyl native connector
enableTridactylNative = true;
};
}
'';
description = ''
The Firefox package to use. If state version  19.09 then
this should be a wrapped Firefox package. For earlier state
@ -264,6 +275,13 @@ in
)
];
warnings = optional (cfg.enableGnomeExtensions or false) ''
Using 'programs.firefox.enableGnomeExtensions' has been deprecated and
will be removed in the future. Please change to overriding the package
configuration using 'programs.firefox.package' instead. You can refer to
its example for how to do this.
'';
home.packages =
let
# The configuration expected by the Firefox wrapper.

View file

@ -1,4 +1,5 @@
{
firefox-profile-settings = ./profile-settings.nix;
firefox-state-version-19_09 = ./state-version-19_09.nix;
firefox-deprecated-native-messenger = ./deprecated-native-messenger.nix;
}

View file

@ -0,0 +1,33 @@
{ config, lib, pkgs, ... }:
with lib;
{
config = {
programs.firefox = {
enable = true;
enableGnomeExtensions = true;
};
nixpkgs.overlays = [
(self: super: {
firefox-unwrapped = pkgs.runCommand "firefox-0" {
meta.description = "I pretend to be Firefox";
preferLocalBuild = true;
allowSubstitutes = false;
} ''
mkdir -p "$out/bin"
touch "$out/bin/firefox"
chmod 755 "$out/bin/firefox"
'';
})
];
test.asserts.warnings.expected = [''
Using 'programs.firefox.enableGnomeExtensions' has been deprecated and
will be removed in the future. Please change to overriding the package
configuration using 'programs.firefox.package' instead. You can refer to
its example for how to do this.
''];
};
}