diff --git a/home/programs/qutebrowser/bookmarks/default.nix b/home/programs/qutebrowser/bookmarks/default.nix index 4c2877e..64d021c 100644 --- a/home/programs/qutebrowser/bookmarks/default.nix +++ b/home/programs/qutebrowser/bookmarks/default.nix @@ -49,10 +49,20 @@ isCards = true; items = acc.pending; } - ++ [{isCards = false; folder = item;}]; + ++ [ + { + isCards = false; + folder = item; + } + ]; pending = []; }; - result = lib.foldl' step {chunks = []; pending = [];} items; + result = + lib.foldl' step { + chunks = []; + pending = []; + } + items; chunks = result.chunks ++ lib.optional (result.pending != []) { @@ -97,7 +107,12 @@ isRoot = true; items = acc.pending; } - ++ [{isRoot = false; inherit item;}]; + ++ [ + { + isRoot = false; + inherit item; + } + ]; pending = []; }; result = @@ -125,11 +140,13 @@ # Recursively collect all leaf bookmarks with their full folder path collectBookmarks = prefix: items: - lib.concatMapStrings (item: - if item ? url - then "${item.url} ${prefix}${item.name}\n" - else collectBookmarks "${prefix}${item.name}/" item.bookmarks - ) items; + lib.concatMapStrings ( + item: + if item ? url + then "${item.url} ${prefix}${item.name}\n" + else collectBookmarks "${prefix}${item.name}/" item.bookmarks + ) + items; publicBookmarks = pkgs.writeText "qutebrowser-public-bookmarks" @@ -475,10 +492,16 @@ in { ''; - home.activation.qutebrowserBookmarks = lib.hm.dag.entryAfter ["setupSecrets" "writeBoundary"] '' + home.activation.qutebrowserBookmarks = lib.hm.dag.entryAfter ["writeBoundary"] '' mkdir -p ${config.home.homeDirectory}/.config/qutebrowser/bookmarks - cat ${publicBookmarks} ${lib.optionalString (privateBookmarksPath != null) ''"${privateBookmarksPath}"''} \ - > ${config.home.homeDirectory}/.config/qutebrowser/bookmarks/urls + { + cat ${publicBookmarks} + ${lib.optionalString (privateBookmarksPath != null) '' + if [ -f "${privateBookmarksPath}" ]; then + cat "${privateBookmarksPath}" + fi + ''} + } > ${config.home.homeDirectory}/.config/qutebrowser/bookmarks/urls ''; }; } diff --git a/home/programs/qutebrowser/bookmarks/general.nix b/home/programs/qutebrowser/bookmarks/general.nix index 0fda5d5..f4dad59 100644 --- a/home/programs/qutebrowser/bookmarks/general.nix +++ b/home/programs/qutebrowser/bookmarks/general.nix @@ -19,8 +19,4 @@ name = "Github"; url = "https://github.com"; } - { - name = "Feedly"; - url = "https://feedly.com"; - } ] diff --git a/home/programs/qutebrowser/bookmarks/other.nix b/home/programs/qutebrowser/bookmarks/other.nix index 4787594..8d7ab03 100644 --- a/home/programs/qutebrowser/bookmarks/other.nix +++ b/home/programs/qutebrowser/bookmarks/other.nix @@ -29,6 +29,10 @@ name = "Startpage Config"; url = "https://www.startpage.com/do/mypage.pl?prfe=45d331deb05471d659dba933e7400df51d952bb103da6f6125c0e769a6be1d65610456a479f495ceeee7e97311cf227d7c1bb198de0ceeb193d8cddf9c455c19a409cc35c3e3f542ee27bd7cecd3"; } + { + name = "Feedly"; + url = "https://feedly.com"; + } { name = "MyNixOS"; url = "https://mynixos.com";