From ad0614a1ec9cce3b13169e20ceb7e55dfaf2a818 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Sun, 23 Mar 2025 19:13:55 -0400 Subject: [PATCH] firefox: don't show migration warning when bookmarks isn't set (#6689) --- modules/programs/firefox/mkFirefoxModule.nix | 36 +++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/modules/programs/firefox/mkFirefoxModule.nix b/modules/programs/firefox/mkFirefoxModule.nix index d2317cc16..341c8ba12 100644 --- a/modules/programs/firefox/mkFirefoxModule.nix +++ b/modules/programs/firefox/mkFirefoxModule.nix @@ -383,27 +383,31 @@ in { bookmarks = mkOption { type = (with types; coercedTo bookmarkTypes.settingsType (bookmarks: - warn '' - ${cfg.name} bookmarks have been refactored into a submodule that now explicitly require a 'force' option to be enabled. + if bookmarks != { } then + warn '' + ${cfg.name} bookmarks have been refactored into a submodule that now explicitly require a 'force' option to be enabled. - Replace: + Replace: - ${moduleName}.profiles.${name}.bookmarks = [ ... ]; + ${moduleName}.profiles.${name}.bookmarks = [ ... ]; - With: + With: - ${moduleName}.profiles.${name}.bookmarks = { + ${moduleName}.profiles.${name}.bookmarks = { + force = true; + settings = [ ... ]; + }; + '' { force = true; - settings = [ ... ]; - }; - '' { - force = true; - settings = bookmarks; - }) (submodule ({ config, ... }: - import ./profiles/bookmarks.nix { - inherit config lib pkgs; - modulePath = modulePath ++ [ "profiles" name "bookmarks" ]; - }))); + settings = bookmarks; + } + else + { }) (submodule ({ config, ... }: + import ./profiles/bookmarks.nix { + inherit config lib pkgs; + modulePath = modulePath + ++ [ "profiles" name "bookmarks" ]; + }))); default = { }; internal = !enableBookmarks; description = "Declarative bookmarks.";