1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-28 21:21:02 +01:00

firefox: fix search options without a default engine

This commit is contained in:
Kira Bruneau 2023-01-06 19:13:13 -05:00 committed by Robert Helgesson
parent c7c69ec405
commit 564b82b354
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
3 changed files with 93 additions and 10 deletions

View file

@ -653,15 +653,21 @@ in {
+ "from outside of ${appName} is a malicious act, and will be responded "
+ "to accordingly.";
salt = profile.path + profile.search.default
+ disclaimer "Firefox";
salt = if profile.search.default != null then
profile.path + profile.search.default + disclaimer "Firefox"
else
null;
in pkgs.runCommand "search.json.mozlz4" {
nativeBuildInputs = with pkgs; [ mozlz4a openssl ];
json = builtins.toJSON settings;
inherit salt;
} ''
export hash=$(echo -n "$salt" | openssl dgst -sha256 -binary | base64)
mozlz4a <(substituteStream json search.json.in --subst-var hash) "$out"
if [[ -n $salt ]]; then
export hash=$(echo -n "$salt" | openssl dgst -sha256 -binary | base64)
mozlz4a <(substituteStream json search.json.in --subst-var hash) "$out"
else
mozlz4a <(echo "$json") "$out"
fi
'';
};