mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
firefox: assert bookmarks migration warning
This commit is contained in:
@@ -483,25 +483,11 @@ in
|
||||
(
|
||||
bookmarks:
|
||||
if bookmarks != { } then
|
||||
lib.warn
|
||||
''
|
||||
${cfg.name} bookmarks have been refactored into a submodule that now explicitly require a 'force' option to be enabled.
|
||||
|
||||
Replace:
|
||||
|
||||
${moduleName}.profiles.${name}.bookmarks = [ ... ];
|
||||
|
||||
With:
|
||||
|
||||
${moduleName}.profiles.${name}.bookmarks = {
|
||||
force = true;
|
||||
settings = [ ... ];
|
||||
};
|
||||
''
|
||||
{
|
||||
force = true;
|
||||
settings = bookmarks;
|
||||
}
|
||||
{
|
||||
force = true;
|
||||
_legacySettings = if builtins.isList bookmarks then "a list" else "an attribute set";
|
||||
settings = bookmarks;
|
||||
}
|
||||
else
|
||||
{ }
|
||||
)
|
||||
@@ -1028,7 +1014,59 @@ in
|
||||
++ optional (cfg.vendorPath != null) ''
|
||||
Using '${moduleName}.vendorPath' has been deprecated and
|
||||
will be removed in the future. Native messaging hosts will function normally without specifying this path.
|
||||
'';
|
||||
''
|
||||
++ lib.flatten (
|
||||
lib.mapAttrsToList (
|
||||
name: profile:
|
||||
lib.optional (profile.bookmarks._legacySettings != null) (
|
||||
let
|
||||
legacySettingsExample =
|
||||
if profile.bookmarks._legacySettings == "a list" then "[ ... ]" else "{ ... }";
|
||||
in
|
||||
lib.hm.deprecations.mkDeprecatedOptionValueWarning {
|
||||
option = modulePath ++ [
|
||||
"profiles"
|
||||
name
|
||||
"bookmarks"
|
||||
];
|
||||
old = profile.bookmarks._legacySettings;
|
||||
replacement = "`${
|
||||
lib.showOption (
|
||||
modulePath
|
||||
++ [
|
||||
"profiles"
|
||||
name
|
||||
"bookmarks"
|
||||
"settings"
|
||||
]
|
||||
)
|
||||
}` with `${
|
||||
lib.showOption (
|
||||
modulePath
|
||||
++ [
|
||||
"profiles"
|
||||
name
|
||||
"bookmarks"
|
||||
"force"
|
||||
]
|
||||
)
|
||||
} = true`";
|
||||
details = ''
|
||||
Set `force = true` to acknowledge replacing existing custom bookmarks.
|
||||
|
||||
Replace:
|
||||
${moduleName}.profiles.${name}.bookmarks = ${legacySettingsExample};
|
||||
|
||||
With:
|
||||
${moduleName}.profiles.${name}.bookmarks = {
|
||||
force = true;
|
||||
settings = ${legacySettingsExample};
|
||||
};
|
||||
'';
|
||||
}
|
||||
)
|
||||
) cfg.profiles
|
||||
);
|
||||
targets.darwin.defaults = (
|
||||
mkIf (cfg.darwinDefaultsId != null && isDarwin) {
|
||||
|
||||
|
||||
@@ -84,6 +84,12 @@ in
|
||||
];
|
||||
|
||||
options = {
|
||||
_legacySettings = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
visible = false;
|
||||
};
|
||||
|
||||
enable = mkOption {
|
||||
type = with types; bool;
|
||||
default = config.settings != [ ];
|
||||
|
||||
Reference in New Issue
Block a user