1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-29 01:48:31 +02:00

firefox: use coercedTo to convert bookmarks to a list

This commit is contained in:
rcerc 2022-07-21 16:52:47 -04:00 committed by Robert Helgesson
parent f47611fb17
commit f91fb470bc
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89

View File

@ -86,8 +86,7 @@ let
lib.concatStringsSep "\n" lib.concatStringsSep "\n"
(map (itemToHTMLOrRecurse indentLevel) bookmarks); (map (itemToHTMLOrRecurse indentLevel) bookmarks);
bookmarkEntries = allItemsToHTML 1 bookmarkEntries = allItemsToHTML 1 bookmarks;
(if isAttrs bookmarks then lib.attrValues bookmarks else bookmarks);
in pkgs.writeText "firefox-bookmarks.html" '' in pkgs.writeText "firefox-bookmarks.html" ''
<!DOCTYPE NETSCAPE-Bookmark-file-1> <!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file. <!-- This is an automatically generated file.
@ -292,9 +291,10 @@ in {
}) // { }) // {
description = "directory submodule"; description = "directory submodule";
}; };
nodeType = types.either bookmarkType directoryType;
in with types; in with types;
either (attrsOf bookmarkType) coercedTo (attrsOf nodeType) attrValues (listOf nodeType);
(listOf (either bookmarkType directoryType));
default = [ ]; default = [ ];
example = literalExpression '' example = literalExpression ''
[ [