Trying to configure Epiphany with home-manager

Hello,

I am trying to configure Gnome Web using home-manager, but I can’t get the config to work.

My current (broken) config is as follows:

dconf.settings = {
    ...
    "org/gnome/epiphany" = { # GNOME Web
      "web/enable-adblock" = true;
      "web/enable-popups" = false;
      "web/ask-on-download" = true;
      ...

      homepage-url = "about:newtab";
      start-in-incognito-mode = false;
      restore-session-policy = "always";
      use-google-search-suggestions = false;
      search-engine-providers = [ # ERROR HERE :(
        {
          url = "https://duckduckgo.com/?q=%s&t=epiphany";
          bang = "!d";
          name = "DuckDuckGo";
        }
      ];

      content-filters = [
        "https://easylist-downloads.adblockplus.org/easylist_min_content_blocker.json"
        "https://better.fyi/blockerList.json"
      ];
    };
}

When rebuilding, I get this error:

error: A definition for option `dconf.settings."org/gnome/epiphany".search-engine-providers."[definition 1-entry 1]"' is not of type `GVariant value'. Definition values:
       - In `/home/trude/dotfiles/home.nix': null

This is probably some dumb mistake I made, so I apologize for that in advance.
Help would be greatly appreciated!

(Also, is there a way to not have to type “web/…” all the time?)
Thank you.

The option expects an array of dictionaries (i.e. array of array of dictionary entries):

So you need to use the following syntax:

search-engine-providers = [
  [
    (mkDictionaryEntry "url" (mkVariant "https://duckduckgo.com/?q=%s&t=epiphany"))
    (mkDictionaryEntry "bang" (mkVariant "!d"))
    (mkDictionaryEntry "name" (mkVariant "DuckDuckGo"))
  ]
];

Also the top-level keys need to be directory paths:

"org/gnome/epiphany/web" = {
  "enable-adblock" = true;
  # …
};
"org/gnome/epiphany" = {
  # …
};

Ideally, you would be able to generate it with dconf2nix but dictionaries are not currently supported.

Thank you so much!
I tried dconf2nix before asking, but it did crash on me, so I figured it wouldn’t work.