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:
parent
c7c69ec405
commit
564b82b354
3 changed files with 93 additions and 10 deletions
|
|
@ -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
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue