firefox: improve search engine disclaimer generation

Using a fixed application name in the salt for the search engine name
hash can break with minor branding changes. For example, LibreWolf 127
used the application name "LibreWolf", but in version 128 it is
"Firefox".

The proper name can be found in about:support -> Application Basics.

Because it doesn't have to be related to the product name visible in
most of the browser (for example in the window title and help menus),
we shouldn't rely on cfg.name for that.

The application name can be read from lib/*/application.ini and we can
use that if the browser was installed via Home Manager. If not, we can
fall back to cfg.name.
This commit is contained in:
Kacper Koniuszy 2024-07-27 10:55:09 +02:00 committed by Robert Helgesson
parent 5056a1cf0c
commit aecd341dfe
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED
3 changed files with 23 additions and 3 deletions

View file

@ -553,6 +553,7 @@ in {
inherit (args) config;
inherit lib pkgs;
appName = cfg.name;
package = cfg.finalPackage;
modulePath = modulePath ++ [ "profiles" name "search" ];
profilePath = config.path;
});