lib: let
withTag = {
bookmarks,
tags,
}: (
map (x:
if (builtins.hasAttr "bookmarks" x)
then {
inherit (x) name;
toolbar = false;
bookmarks = withTag {
inherit (x) bookmarks;
tags = [(builtins.toString x.name)] ++ tags;
};
}
else {
inherit (x) name url;
tags = (x.tags or []) ++ tags;
})
bookmarks
);
in (
withTag {
bookmarks = builtins.fromJSON (builtins.readFile ./bookmarks.json);
tags = [];
)