mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-09 03:56:04 +01:00
firefox: refactor bookmarks into a submodule & require force (#6402)
This splits the bookmarks submodule into a seperate file, to make it easier to maintain (like how the search module was previously split out in #5697). This also refactors bookmarks to require a new force option, to be more explicit about overriding existing bookmarks.
This commit is contained in:
parent
1727f417b7
commit
9d554281e0
5 changed files with 317 additions and 231 deletions
|
|
@ -56,10 +56,10 @@ let
|
||||||
else
|
else
|
||||||
builtins.toJSON pref);
|
builtins.toJSON pref);
|
||||||
|
|
||||||
mkUserJs = prePrefs: prefs: extraPrefs: bookmarks: extensions:
|
mkUserJs = prePrefs: prefs: extraPrefs: bookmarksFile: extensions:
|
||||||
let
|
let
|
||||||
prefs' = lib.optionalAttrs ([ ] != bookmarks) {
|
prefs' = lib.optionalAttrs (bookmarksFile != null) {
|
||||||
"browser.bookmarks.file" = toString (browserBookmarksFile bookmarks);
|
"browser.bookmarks.file" = toString bookmarksFile;
|
||||||
"browser.places.importBookmarksHTML" = true;
|
"browser.places.importBookmarksHTML" = true;
|
||||||
} // lib.optionalAttrs (extensions != { }) {
|
} // lib.optionalAttrs (extensions != { }) {
|
||||||
"extensions.webextensions.ExtensionStorageIDB.enabled" = false;
|
"extensions.webextensions.ExtensionStorageIDB.enabled" = false;
|
||||||
|
|
@ -112,59 +112,6 @@ let
|
||||||
}}
|
}}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
browserBookmarksFile = bookmarks:
|
|
||||||
let
|
|
||||||
indent = level:
|
|
||||||
lib.concatStringsSep "" (map (lib.const " ") (lib.range 1 level));
|
|
||||||
|
|
||||||
bookmarkToHTML = indentLevel: bookmark:
|
|
||||||
''
|
|
||||||
${indent indentLevel}<DT><A HREF="${
|
|
||||||
escapeXML bookmark.url
|
|
||||||
}" ADD_DATE="1" LAST_MODIFIED="1"${
|
|
||||||
lib.optionalString (bookmark.keyword != null)
|
|
||||||
" SHORTCUTURL=\"${escapeXML bookmark.keyword}\""
|
|
||||||
}${
|
|
||||||
lib.optionalString (bookmark.tags != [ ])
|
|
||||||
" TAGS=\"${escapeXML (concatStringsSep "," bookmark.tags)}\""
|
|
||||||
}>${escapeXML bookmark.name}</A>'';
|
|
||||||
|
|
||||||
directoryToHTML = indentLevel: directory: ''
|
|
||||||
${indent indentLevel}<DT>${
|
|
||||||
if directory.toolbar then
|
|
||||||
''
|
|
||||||
<H3 ADD_DATE="1" LAST_MODIFIED="1" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Toolbar''
|
|
||||||
else
|
|
||||||
''<H3 ADD_DATE="1" LAST_MODIFIED="1">${escapeXML directory.name}''
|
|
||||||
}</H3>
|
|
||||||
${indent indentLevel}<DL><p>
|
|
||||||
${allItemsToHTML (indentLevel + 1) directory.bookmarks}
|
|
||||||
${indent indentLevel}</DL><p>'';
|
|
||||||
|
|
||||||
itemToHTMLOrRecurse = indentLevel: item:
|
|
||||||
if item ? "url" then
|
|
||||||
bookmarkToHTML indentLevel item
|
|
||||||
else
|
|
||||||
directoryToHTML indentLevel item;
|
|
||||||
|
|
||||||
allItemsToHTML = indentLevel: bookmarks:
|
|
||||||
lib.concatStringsSep "\n"
|
|
||||||
(map (itemToHTMLOrRecurse indentLevel) bookmarks);
|
|
||||||
|
|
||||||
bookmarkEntries = allItemsToHTML 1 bookmarks;
|
|
||||||
in pkgs.writeText "${packageName}-bookmarks.html" ''
|
|
||||||
<!DOCTYPE NETSCAPE-Bookmark-file-1>
|
|
||||||
<!-- This is an automatically generated file.
|
|
||||||
It will be read and overwritten.
|
|
||||||
DO NOT EDIT! -->
|
|
||||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
|
||||||
<TITLE>Bookmarks</TITLE>
|
|
||||||
<H1>Bookmarks Menu</H1>
|
|
||||||
<DL><p>
|
|
||||||
${bookmarkEntries}
|
|
||||||
</DL>
|
|
||||||
'';
|
|
||||||
|
|
||||||
mkNoDuplicateAssertion = entities: entityKind:
|
mkNoDuplicateAssertion = entities: entityKind:
|
||||||
(let
|
(let
|
||||||
# Return an attribute set with entity IDs as keys and a list of
|
# Return an attribute set with entity IDs as keys and a list of
|
||||||
|
|
@ -334,6 +281,8 @@ in {
|
||||||
profiles = mkOption {
|
profiles = mkOption {
|
||||||
inherit visible;
|
inherit visible;
|
||||||
type = types.attrsOf (types.submodule ({ config, name, ... }: {
|
type = types.attrsOf (types.submodule ({ config, name, ... }: {
|
||||||
|
imports = [ (pkgs.path + "/nixos/modules/misc/assertions.nix") ];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
name = mkOption {
|
name = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
|
@ -430,104 +379,32 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
bookmarks = mkOption {
|
bookmarks = mkOption {
|
||||||
|
type = (with types;
|
||||||
|
coercedTo (listOf anything) (bookmarks:
|
||||||
|
warn ''
|
||||||
|
${cfg.name} bookmarks have been refactored into a submodule that now explicitly require a 'force' option to be enabled.
|
||||||
|
|
||||||
|
Replace:
|
||||||
|
|
||||||
|
${moduleName}.profiles.${name}.bookmarks = [ ... ];
|
||||||
|
|
||||||
|
With:
|
||||||
|
|
||||||
|
${moduleName}.profiles.${name}.bookmarks = {
|
||||||
|
force = true;
|
||||||
|
settings = [ ... ];
|
||||||
|
};
|
||||||
|
'' {
|
||||||
|
force = true;
|
||||||
|
settings = bookmarks;
|
||||||
|
}) (submodule ({ config, ... }:
|
||||||
|
import ./profiles/bookmarks.nix {
|
||||||
|
inherit config lib pkgs;
|
||||||
|
modulePath = modulePath ++ [ "profiles" name "bookmarks" ];
|
||||||
|
})));
|
||||||
|
default = { };
|
||||||
internal = !enableBookmarks;
|
internal = !enableBookmarks;
|
||||||
type = let
|
description = "Declarative bookmarks.";
|
||||||
bookmarkSubmodule = types.submodule ({ config, name, ... }: {
|
|
||||||
options = {
|
|
||||||
name = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = name;
|
|
||||||
description = "Bookmark name.";
|
|
||||||
};
|
|
||||||
|
|
||||||
tags = mkOption {
|
|
||||||
type = types.listOf types.str;
|
|
||||||
default = [ ];
|
|
||||||
description = "Bookmark tags.";
|
|
||||||
};
|
|
||||||
|
|
||||||
keyword = mkOption {
|
|
||||||
type = types.nullOr types.str;
|
|
||||||
default = null;
|
|
||||||
description = "Bookmark search keyword.";
|
|
||||||
};
|
|
||||||
|
|
||||||
url = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
description = "Bookmark url, use %s for search terms.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}) // {
|
|
||||||
description = "bookmark submodule";
|
|
||||||
};
|
|
||||||
|
|
||||||
bookmarkType = types.addCheck bookmarkSubmodule (x: x ? "url");
|
|
||||||
|
|
||||||
directoryType = types.submodule ({ config, name, ... }: {
|
|
||||||
options = {
|
|
||||||
name = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = name;
|
|
||||||
description = "Directory name.";
|
|
||||||
};
|
|
||||||
|
|
||||||
bookmarks = mkOption {
|
|
||||||
type = types.listOf nodeType;
|
|
||||||
default = [ ];
|
|
||||||
description = "Bookmarks within directory.";
|
|
||||||
};
|
|
||||||
|
|
||||||
toolbar = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = ''
|
|
||||||
Make this the toolbar directory. Note, this does _not_
|
|
||||||
mean that this directory will be added to the toolbar,
|
|
||||||
this directory _is_ the toolbar.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}) // {
|
|
||||||
description = "directory submodule";
|
|
||||||
};
|
|
||||||
|
|
||||||
nodeType = types.either bookmarkType directoryType;
|
|
||||||
in with types;
|
|
||||||
coercedTo (attrsOf nodeType) attrValues (listOf nodeType);
|
|
||||||
default = [ ];
|
|
||||||
example = literalExpression ''
|
|
||||||
[
|
|
||||||
{
|
|
||||||
name = "wikipedia";
|
|
||||||
tags = [ "wiki" ];
|
|
||||||
keyword = "wiki";
|
|
||||||
url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "kernel.org";
|
|
||||||
url = "https://www.kernel.org";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "Nix sites";
|
|
||||||
toolbar = true;
|
|
||||||
bookmarks = [
|
|
||||||
{
|
|
||||||
name = "homepage";
|
|
||||||
url = "https://nixos.org/";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "wiki";
|
|
||||||
tags = [ "wiki" "nix" ];
|
|
||||||
url = "https://wiki.nixos.org/";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
]
|
|
||||||
'';
|
|
||||||
description = ''
|
|
||||||
Preloaded bookmarks. Note, this may silently overwrite any
|
|
||||||
previously existing bookmarks!
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
path = mkOption {
|
path = mkOption {
|
||||||
|
|
@ -763,6 +640,26 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
assertions = [
|
||||||
|
(mkNoDuplicateAssertion config.containers "container")
|
||||||
|
{
|
||||||
|
assertion = config.extensions.settings == { }
|
||||||
|
|| config.extensions.force;
|
||||||
|
message = ''
|
||||||
|
Using '${
|
||||||
|
lib.showAttrPath (modulePath
|
||||||
|
++ [ "profiles" profileName "extensions" "settings" ])
|
||||||
|
}' will override all previous extensions settings.
|
||||||
|
Enable '${
|
||||||
|
lib.showAttrPath (modulePath
|
||||||
|
++ [ "profiles" profileName "extensions" "force" ])
|
||||||
|
}' to acknowledge this.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
] ++ config.bookmarks.assertions;
|
||||||
|
};
|
||||||
}));
|
}));
|
||||||
default = { };
|
default = { };
|
||||||
description = "Attribute set of ${appName} profiles.";
|
description = "Attribute set of ${appName} profiles.";
|
||||||
|
|
@ -826,22 +723,7 @@ in {
|
||||||
}
|
}
|
||||||
|
|
||||||
(mkNoDuplicateAssertion cfg.profiles "profile")
|
(mkNoDuplicateAssertion cfg.profiles "profile")
|
||||||
] ++ (mapAttrsToList
|
] ++ (concatMap (profile: profile.assertions) (attrValues cfg.profiles));
|
||||||
(_: profile: mkNoDuplicateAssertion profile.containers "container")
|
|
||||||
cfg.profiles) ++ (mapAttrsToList (profileName: profile: {
|
|
||||||
assertion = profile.extensions.settings == { }
|
|
||||||
|| profile.extensions.force;
|
|
||||||
message = ''
|
|
||||||
Using '${
|
|
||||||
lib.showAttrPath
|
|
||||||
(modulePath ++ [ "profiles" profileName "extensions" "settings" ])
|
|
||||||
}' will override all previous extensions settings.
|
|
||||||
Enable '${
|
|
||||||
lib.showAttrPath
|
|
||||||
(modulePath ++ [ "profiles" profileName "extensions" "force" ])
|
|
||||||
}' to acknowledge this.
|
|
||||||
'';
|
|
||||||
}) cfg.profiles);
|
|
||||||
|
|
||||||
warnings = optional (cfg.enableGnomeExtensions or false) ''
|
warnings = optional (cfg.enableGnomeExtensions or false) ''
|
||||||
Using '${moduleName}.enableGnomeExtensions' has been deprecated and
|
Using '${moduleName}.enableGnomeExtensions' has been deprecated and
|
||||||
|
|
@ -883,10 +765,10 @@ in {
|
||||||
|
|
||||||
"${profilesPath}/${profile.path}/user.js" = mkIf (profile.preConfig
|
"${profilesPath}/${profile.path}/user.js" = mkIf (profile.preConfig
|
||||||
!= "" || profile.settings != { } || profile.extraConfig != ""
|
!= "" || profile.settings != { } || profile.extraConfig != ""
|
||||||
|| profile.bookmarks != [ ]) {
|
|| profile.bookmarks.configFile != null) {
|
||||||
text =
|
text =
|
||||||
mkUserJs profile.preConfig profile.settings profile.extraConfig
|
mkUserJs profile.preConfig profile.settings profile.extraConfig
|
||||||
profile.bookmarks profile.extensions.settings;
|
profile.bookmarks.configFile profile.extensions.settings;
|
||||||
};
|
};
|
||||||
|
|
||||||
"${profilesPath}/${profile.path}/containers.json" =
|
"${profilesPath}/${profile.path}/containers.json" =
|
||||||
|
|
|
||||||
203
modules/programs/firefox/profiles/bookmarks.nix
Normal file
203
modules/programs/firefox/profiles/bookmarks.nix
Normal file
|
|
@ -0,0 +1,203 @@
|
||||||
|
{ config, lib, pkgs, modulePath }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
bookmarkSubmodule = types.submodule ({ name, ... }: {
|
||||||
|
options = {
|
||||||
|
name = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = name;
|
||||||
|
description = "Bookmark name.";
|
||||||
|
};
|
||||||
|
|
||||||
|
tags = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [ ];
|
||||||
|
description = "Bookmark tags.";
|
||||||
|
};
|
||||||
|
|
||||||
|
keyword = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
description = "Bookmark search keyword.";
|
||||||
|
};
|
||||||
|
|
||||||
|
url = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = "Bookmark url, use %s for search terms.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}) // {
|
||||||
|
description = "bookmark submodule";
|
||||||
|
};
|
||||||
|
|
||||||
|
bookmarkType = types.addCheck bookmarkSubmodule (x: x ? "url");
|
||||||
|
|
||||||
|
directoryType = types.submodule ({ name, ... }: {
|
||||||
|
options = {
|
||||||
|
name = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = name;
|
||||||
|
description = "Directory name.";
|
||||||
|
};
|
||||||
|
|
||||||
|
bookmarks = mkOption {
|
||||||
|
type = types.listOf nodeType;
|
||||||
|
default = [ ];
|
||||||
|
description = "Bookmarks within directory.";
|
||||||
|
};
|
||||||
|
|
||||||
|
toolbar = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Make this the toolbar directory. Note, this does _not_
|
||||||
|
mean that this directory will be added to the toolbar,
|
||||||
|
this directory _is_ the toolbar.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}) // {
|
||||||
|
description = "directory submodule";
|
||||||
|
};
|
||||||
|
|
||||||
|
nodeType = types.either bookmarkType directoryType;
|
||||||
|
|
||||||
|
bookmarksFile = bookmarks:
|
||||||
|
let
|
||||||
|
indent = level:
|
||||||
|
lib.concatStringsSep "" (map (lib.const " ") (lib.range 1 level));
|
||||||
|
|
||||||
|
bookmarkToHTML = indentLevel: bookmark:
|
||||||
|
''
|
||||||
|
${indent indentLevel}<DT><A HREF="${
|
||||||
|
escapeXML bookmark.url
|
||||||
|
}" ADD_DATE="1" LAST_MODIFIED="1"${
|
||||||
|
lib.optionalString (bookmark.keyword != null)
|
||||||
|
" SHORTCUTURL=\"${escapeXML bookmark.keyword}\""
|
||||||
|
}${
|
||||||
|
lib.optionalString (bookmark.tags != [ ])
|
||||||
|
" TAGS=\"${escapeXML (concatStringsSep "," bookmark.tags)}\""
|
||||||
|
}>${escapeXML bookmark.name}</A>'';
|
||||||
|
|
||||||
|
directoryToHTML = indentLevel: directory: ''
|
||||||
|
${indent indentLevel}<DT>${
|
||||||
|
if directory.toolbar then
|
||||||
|
''
|
||||||
|
<H3 ADD_DATE="1" LAST_MODIFIED="1" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Toolbar''
|
||||||
|
else
|
||||||
|
''<H3 ADD_DATE="1" LAST_MODIFIED="1">${escapeXML directory.name}''
|
||||||
|
}</H3>
|
||||||
|
${indent indentLevel}<DL><p>
|
||||||
|
${allItemsToHTML (indentLevel + 1) directory.bookmarks}
|
||||||
|
${indent indentLevel}</DL><p>'';
|
||||||
|
|
||||||
|
itemToHTMLOrRecurse = indentLevel: item:
|
||||||
|
if item ? "url" then
|
||||||
|
bookmarkToHTML indentLevel item
|
||||||
|
else
|
||||||
|
directoryToHTML indentLevel item;
|
||||||
|
|
||||||
|
allItemsToHTML = indentLevel: bookmarks:
|
||||||
|
lib.concatStringsSep "\n"
|
||||||
|
(map (itemToHTMLOrRecurse indentLevel) bookmarks);
|
||||||
|
|
||||||
|
bookmarkEntries = allItemsToHTML 1 bookmarks;
|
||||||
|
in pkgs.writeText "bookmarks.html" ''
|
||||||
|
<!DOCTYPE NETSCAPE-Bookmark-file-1>
|
||||||
|
<!-- This is an automatically generated file.
|
||||||
|
It will be read and overwritten.
|
||||||
|
DO NOT EDIT! -->
|
||||||
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||||
|
<TITLE>Bookmarks</TITLE>
|
||||||
|
<H1>Bookmarks Menu</H1>
|
||||||
|
<DL><p>
|
||||||
|
${bookmarkEntries}
|
||||||
|
</DL>
|
||||||
|
'';
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
(pkgs.path + "/nixos/modules/misc/assertions.nix")
|
||||||
|
(pkgs.path + "/nixos/modules/misc/meta.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
# We're currently looking for a maintainer who actively uses bookmarks!
|
||||||
|
meta.maintainers = with maintainers; [ kira-bruneau ];
|
||||||
|
|
||||||
|
options = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = with types; bool;
|
||||||
|
default = config.settings != [ ];
|
||||||
|
internal = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
force = mkOption {
|
||||||
|
type = with types; bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Whether to force override existing custom bookmarks.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = with types;
|
||||||
|
coercedTo (attrsOf nodeType) attrValues (listOf nodeType);
|
||||||
|
default = [ ];
|
||||||
|
example = literalExpression ''
|
||||||
|
[
|
||||||
|
{
|
||||||
|
name = "wikipedia";
|
||||||
|
tags = [ "wiki" ];
|
||||||
|
keyword = "wiki";
|
||||||
|
url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "kernel.org";
|
||||||
|
url = "https://www.kernel.org";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "Nix sites";
|
||||||
|
toolbar = true;
|
||||||
|
bookmarks = [
|
||||||
|
{
|
||||||
|
name = "homepage";
|
||||||
|
url = "https://nixos.org/";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "wiki";
|
||||||
|
tags = [ "wiki" "nix" ];
|
||||||
|
url = "https://wiki.nixos.org/";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
]
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Custom bookmarks.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
configFile = mkOption {
|
||||||
|
type = with types; nullOr path;
|
||||||
|
default = if config.enable then bookmarksFile config.settings else null;
|
||||||
|
description = ''
|
||||||
|
Configuration file to define custom bookmarks.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
assertions = [{
|
||||||
|
assertion = config.enable -> config.force;
|
||||||
|
message = ''
|
||||||
|
Using '${
|
||||||
|
lib.showAttrPath (modulePath ++ [ "settings" ])
|
||||||
|
}' will override all previous bookmarks.
|
||||||
|
Enable ${
|
||||||
|
lib.showAttrPath (modulePath ++ [ "force" ])
|
||||||
|
}' to acknowledge this.
|
||||||
|
'';
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -7,12 +7,6 @@ let
|
||||||
|
|
||||||
firefoxMockOverlay = import ../../setup-firefox-mock-overlay.nix modulePath;
|
firefoxMockOverlay = import ../../setup-firefox-mock-overlay.nix modulePath;
|
||||||
|
|
||||||
withName = path:
|
|
||||||
pkgs.substituteAll {
|
|
||||||
src = path;
|
|
||||||
name = cfg.wrappedPackageName;
|
|
||||||
};
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
imports = [ firefoxMockOverlay ];
|
imports = [ firefoxMockOverlay ];
|
||||||
|
|
||||||
|
|
@ -20,7 +14,9 @@ in {
|
||||||
enable = true;
|
enable = true;
|
||||||
profiles.bookmarks = {
|
profiles.bookmarks = {
|
||||||
settings = { "general.smoothScroll" = false; };
|
settings = { "general.smoothScroll" = false; };
|
||||||
bookmarks = [
|
bookmarks = {
|
||||||
|
force = true;
|
||||||
|
settings = [
|
||||||
{
|
{
|
||||||
toolbar = true;
|
toolbar = true;
|
||||||
bookmarks = [{
|
bookmarks = [{
|
||||||
|
|
@ -32,7 +28,8 @@ in {
|
||||||
name = "wikipedia";
|
name = "wikipedia";
|
||||||
tags = [ "wiki" ];
|
tags = [ "wiki" ];
|
||||||
keyword = "wiki";
|
keyword = "wiki";
|
||||||
url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go";
|
url =
|
||||||
|
"https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "kernel.org";
|
name = "kernel.org";
|
||||||
|
|
@ -67,6 +64,7 @@ in {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
};
|
||||||
} // {
|
} // {
|
||||||
nmt.script = ''
|
nmt.script = ''
|
||||||
bookmarksUserJs=$(normalizeStorePaths \
|
bookmarksUserJs=$(normalizeStorePaths \
|
||||||
|
|
@ -74,7 +72,7 @@ in {
|
||||||
|
|
||||||
assertFileContent \
|
assertFileContent \
|
||||||
$bookmarksUserJs \
|
$bookmarksUserJs \
|
||||||
${withName ./expected-bookmarks-user.js}
|
${./expected-bookmarks-user.js}
|
||||||
|
|
||||||
bookmarksFile="$(sed -n \
|
bookmarksFile="$(sed -n \
|
||||||
'/browser.bookmarks.file/ {s|^.*\(/nix/store[^"]*\).*|\1|;p}' \
|
'/browser.bookmarks.file/ {s|^.*\(/nix/store[^"]*\).*|\1|;p}' \
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
user_pref("browser.bookmarks.file", "/nix/store/00000000000000000000000000000000-@name@-bookmarks.html");
|
user_pref("browser.bookmarks.file", "/nix/store/00000000000000000000000000000000-bookmarks.html");
|
||||||
user_pref("browser.places.importBookmarksHTML", true);
|
user_pref("browser.places.importBookmarksHTML", true);
|
||||||
user_pref("general.smoothScroll", false);
|
user_pref("general.smoothScroll", false);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,16 @@ in {
|
||||||
main = {
|
main = {
|
||||||
isDefault = true;
|
isDefault = true;
|
||||||
id = 1;
|
id = 1;
|
||||||
bookmarks = [{
|
bookmarks = {
|
||||||
|
force = true;
|
||||||
|
settings = [{
|
||||||
toolbar = true;
|
toolbar = true;
|
||||||
bookmarks = [{
|
bookmarks = [{
|
||||||
name = "Home Manager";
|
name = "Home Manager";
|
||||||
url = "https://wiki.nixos.org/wiki/Home_Manager";
|
url = "https://wiki.nixos.org/wiki/Home_Manager";
|
||||||
}];
|
}];
|
||||||
}];
|
}];
|
||||||
|
};
|
||||||
containers = {
|
containers = {
|
||||||
"shopping" = {
|
"shopping" = {
|
||||||
icon = "circle";
|
icon = "circle";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue