firefox: fix bookmarks backwards compatibility

The legacy attrset option type for `firefox.profiles.<name>.bookmarks`
was accidentally removed in 9d55428. This adds back support for this
type by refactoring the bookmarks submodule. This also adds a new test
ensuring this won't happen again.
This commit is contained in:
bricked 2025-03-20 18:08:40 +01:00 committed by Austin Horstman
parent 5ff90f09d1
commit 62d6a8931e
7 changed files with 167 additions and 70 deletions

View file

@ -158,6 +158,8 @@ let
})
else
(pkgs.wrapFirefox.override { config = bcfg; }) package { };
bookmarkTypes = import ./profiles/bookmark-types.nix { inherit lib; };
in {
options = setAttrByPath modulePath {
enable = mkOption {
@ -380,7 +382,7 @@ in {
bookmarks = mkOption {
type = (with types;
coercedTo (listOf anything) (bookmarks:
coercedTo bookmarkTypes.settingsType (bookmarks:
warn ''
${cfg.name} bookmarks have been refactored into a submodule that now explicitly require a 'force' option to be enabled.