firefox: manage add-ons per-profile
Internally we already managed them per-profile but exposed a global option to maintain backwards compatibility. The benefit to having per-profile extensions is quite large though, so it is time to switch. Users of the global extensions option will get an error message that indicates how to edit their configuration to work again.
This commit is contained in:
parent
9621e9ab80
commit
c43d4a3d6d
|
@ -8,7 +8,16 @@ This is the current unstable branch and the information in this section is there
|
|||
|
||||
This release has the following notable changes:
|
||||
|
||||
* No highlights.
|
||||
* Firefox add-ons are now managed per-profile.
|
||||
That is, if you are currently having
|
||||
+
|
||||
[source,nix]
|
||||
programs.firefox.extensions = [ foo bar ];
|
||||
+
|
||||
in your configuration then you must change it to
|
||||
+
|
||||
[source,nix]
|
||||
programs.firefox.profiles.myprofile.extensions = [ foo bar ];
|
||||
|
||||
[[sec-release-23.05-state-version-changes]]
|
||||
=== State Version Changes
|
||||
|
|
|
@ -25,11 +25,6 @@ let
|
|||
# by future Firefox versions.
|
||||
extensionPath = "extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
|
||||
|
||||
extensionsEnvPkg = pkgs.buildEnv {
|
||||
name = "hm-firefox-extensions";
|
||||
paths = cfg.extensions;
|
||||
};
|
||||
|
||||
profiles = flip mapAttrs' cfg.profiles (_: profile:
|
||||
nameValuePair "Profile${toString profile.id}" {
|
||||
Name = profile.name;
|
||||
|
@ -117,6 +112,15 @@ in {
|
|||
meta.maintainers = [ maintainers.rycee maintainers.kira-bruneau ];
|
||||
|
||||
imports = [
|
||||
(mkRemovedOptionModule [ "programs" "firefox" "extensions" ] ''
|
||||
|
||||
Extensions are now managed per-profile. That is, change from
|
||||
|
||||
programs.firefox.extensions = [ foo bar ];
|
||||
|
||||
to
|
||||
|
||||
programs.firefox.profiles.myprofile.extensions = [ foo bar ];'')
|
||||
(mkRemovedOptionModule [ "programs" "firefox" "enableAdobeFlash" ]
|
||||
"Support for this option has been removed.")
|
||||
(mkRemovedOptionModule [ "programs" "firefox" "enableGoogleTalk" ]
|
||||
|
@ -154,41 +158,6 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
extensions = mkOption {
|
||||
type = types.listOf types.package;
|
||||
default = [ ];
|
||||
example = literalExpression ''
|
||||
with pkgs.nur.repos.rycee.firefox-addons; [
|
||||
privacy-badger
|
||||
]
|
||||
'';
|
||||
description = ''
|
||||
List of Firefox add-on packages to install. Some
|
||||
pre-packaged add-ons are accessible from NUR,
|
||||
<link xlink:href="https://github.com/nix-community/NUR"/>.
|
||||
Once you have NUR installed run
|
||||
|
||||
<screen language="console">
|
||||
<prompt>$</prompt> <userinput>nix-env -f '<nixpkgs>' -qaP -A nur.repos.rycee.firefox-addons</userinput>
|
||||
</screen>
|
||||
|
||||
to list the available Firefox add-ons.
|
||||
|
||||
</para><para>
|
||||
|
||||
Note that it is necessary to manually enable these
|
||||
extensions inside Firefox after the first installation.
|
||||
|
||||
</para><para>
|
||||
|
||||
Extensions listed here will only be available in Firefox
|
||||
profiles managed through the
|
||||
<xref linkend="opt-programs.firefox.profiles"/>
|
||||
option. This is due to recent changes in the way Firefox
|
||||
handles extension side-loading.
|
||||
'';
|
||||
};
|
||||
|
||||
profiles = mkOption {
|
||||
type = types.attrsOf (types.submodule ({ config, name, ... }: {
|
||||
options = {
|
||||
|
@ -452,6 +421,34 @@ in {
|
|||
'';
|
||||
};
|
||||
};
|
||||
|
||||
extensions = mkOption {
|
||||
type = types.listOf types.package;
|
||||
default = [ ];
|
||||
example = literalExpression ''
|
||||
with pkgs.nur.repos.rycee.firefox-addons; [
|
||||
privacy-badger
|
||||
]
|
||||
'';
|
||||
description = ''
|
||||
List of Firefox add-on packages to install for this profile.
|
||||
Some pre-packaged add-ons are accessible from NUR,
|
||||
<link xlink:href="https://github.com/nix-community/NUR"/>.
|
||||
Once you have NUR installed run
|
||||
|
||||
<screen language="console">
|
||||
<prompt>$</prompt> <userinput>nix-env -f '<nixpkgs>' -qaP -A nur.repos.rycee.firefox-addons</userinput>
|
||||
</screen>
|
||||
|
||||
to list the available Firefox add-ons.
|
||||
|
||||
</para><para>
|
||||
|
||||
Note that it is necessary to manually enable these extensions
|
||||
inside Firefox after the first installation.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
}));
|
||||
default = { };
|
||||
|
@ -523,11 +520,6 @@ in {
|
|||
in [ package ];
|
||||
|
||||
home.file = mkMerge ([{
|
||||
"${mozillaConfigPath}/${extensionPath}" = mkIf (cfg.extensions != [ ]) {
|
||||
source = "${extensionsEnvPkg}/share/mozilla/${extensionPath}";
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
"${firefoxConfigPath}/profiles.ini" =
|
||||
mkIf (cfg.profiles != { }) { text = profilesIni; };
|
||||
}] ++ flip mapAttrsToList cfg.profiles (_: profile: {
|
||||
|
@ -674,8 +666,13 @@ in {
|
|||
};
|
||||
|
||||
"${profilesPath}/${profile.path}/extensions" =
|
||||
mkIf (cfg.extensions != [ ]) {
|
||||
source = "${extensionsEnvPkg}/share/mozilla/${extensionPath}";
|
||||
mkIf (profile.extensions != [ ]) {
|
||||
source = let
|
||||
extensionsEnvPkg = pkgs.buildEnv {
|
||||
name = "hm-firefox-extensions";
|
||||
paths = profile.extensions;
|
||||
};
|
||||
in "${extensionsEnvPkg}/share/mozilla/${extensionPath}";
|
||||
recursive = true;
|
||||
force = true;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue