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:
@@ -0,0 +1,50 @@
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.programs.firefox;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
(import ./setup-firefox-mock-overlay.nix [
|
||||
"programs"
|
||||
"firefox"
|
||||
])
|
||||
];
|
||||
|
||||
home.stateVersion = "26.05";
|
||||
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
profiles.default.bookmarks = {
|
||||
"Home Manager" = {
|
||||
url = "https://wiki.nixos.org/wiki/Home_Manager";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
test.asserts.warnings.expected = [
|
||||
''
|
||||
Using `programs.firefox.profiles.default.bookmarks` as an attribute set is deprecated and will be
|
||||
removed in a future release. Please use `programs.firefox.profiles.default.bookmarks.settings` with `programs.firefox.profiles.default.bookmarks.force = true` instead.
|
||||
|
||||
Set `force = true` to acknowledge replacing existing custom bookmarks.
|
||||
|
||||
Replace:
|
||||
programs.firefox.profiles.default.bookmarks = { ... };
|
||||
|
||||
With:
|
||||
programs.firefox.profiles.default.bookmarks = {
|
||||
force = true;
|
||||
settings = { ... };
|
||||
};
|
||||
|
||||
''
|
||||
];
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists "home-files/${cfg.profilesPath}/default/user.js"
|
||||
'';
|
||||
}
|
||||
51
tests/modules/programs/firefox/bookmarks-legacy-warning.nix
Normal file
51
tests/modules/programs/firefox/bookmarks-legacy-warning.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.programs.firefox;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
(import ./setup-firefox-mock-overlay.nix [
|
||||
"programs"
|
||||
"firefox"
|
||||
])
|
||||
];
|
||||
|
||||
home.stateVersion = "26.05";
|
||||
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
profiles.default.bookmarks = [
|
||||
{
|
||||
name = "Home Manager";
|
||||
url = "https://wiki.nixos.org/wiki/Home_Manager";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
test.asserts.warnings.expected = [
|
||||
''
|
||||
Using `programs.firefox.profiles.default.bookmarks` as a list is deprecated and will be
|
||||
removed in a future release. Please use `programs.firefox.profiles.default.bookmarks.settings` with `programs.firefox.profiles.default.bookmarks.force = true` instead.
|
||||
|
||||
Set `force = true` to acknowledge replacing existing custom bookmarks.
|
||||
|
||||
Replace:
|
||||
programs.firefox.profiles.default.bookmarks = [ ... ];
|
||||
|
||||
With:
|
||||
programs.firefox.profiles.default.bookmarks = {
|
||||
force = true;
|
||||
settings = [ ... ];
|
||||
};
|
||||
|
||||
''
|
||||
];
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists "home-files/${cfg.profilesPath}/default/user.js"
|
||||
'';
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
{ lib, ... }:
|
||||
{
|
||||
"firefox-bookmarks-legacy-warning" = ./bookmarks-legacy-warning.nix;
|
||||
"firefox-bookmarks-legacy-attrset-warning" = ./bookmarks-legacy-attrset-warning.nix;
|
||||
"firefox-config-path-explicit-legacy" = ./config-path-explicit-legacy.nix;
|
||||
"firefox-config-path-explicit-xdg" = ./config-path-explicit-xdg.nix;
|
||||
"firefox-config-path-xdg-default" = ./config-path-xdg-default.nix;
|
||||
|
||||
@@ -72,6 +72,25 @@ in
|
||||
};
|
||||
}
|
||||
// {
|
||||
test.asserts.warnings.expected = [
|
||||
''
|
||||
Using `${lib.showOption modulePath}.profiles.bookmarks.bookmarks` as an attribute set is deprecated and will be
|
||||
removed in a future release. Please use `${lib.showOption modulePath}.profiles.bookmarks.bookmarks.settings` with `${lib.showOption modulePath}.profiles.bookmarks.bookmarks.force = true` instead.
|
||||
|
||||
Set `force = true` to acknowledge replacing existing custom bookmarks.
|
||||
|
||||
Replace:
|
||||
${lib.showOption modulePath}.profiles.bookmarks.bookmarks = { ... };
|
||||
|
||||
With:
|
||||
${lib.showOption modulePath}.profiles.bookmarks.bookmarks = {
|
||||
force = true;
|
||||
settings = { ... };
|
||||
};
|
||||
|
||||
''
|
||||
];
|
||||
|
||||
nmt.script = ''
|
||||
bookmarksUserJs=$(normalizeStorePaths \
|
||||
"home-files/${cfg.profilesPath}/bookmarks/user.js")
|
||||
|
||||
Reference in New Issue
Block a user