Skip to content

Commit

Permalink
firefox: fix wrong syntax grammar for search setting isAppProvided (#…
Browse files Browse the repository at this point in the history
…6556)

The or operator is left associative, and since there is another
argument after the first term, the interpreter tries to apply whatever
the or-expression evaluates to.  If the first operand is unset, it
evaluates to removeAttrs, and everything is fine, but if it is set to
a boolean (which is what it should be set to), then it tries to apply
a boolean to arguments, and we get a type error.  Bracketing
explicitly with parentheses fixes this.

It presumably went unnoticed because not many people have tried
setting the option
`programs.firefox.profiles.<profile>.search.engines.<engine>.isAppProvided`.
  • Loading branch information
zmberber authored Mar 1, 2025
1 parent f0b5e7e commit 4f05ef6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/programs/firefox/profiles/search.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ let
let
requiredInput = {
inherit name;
isAppProvided = input.isAppProvided or removeAttrs input [ "metaData" ]
== { };
isAppProvided =
input.isAppProvided or (removeAttrs input [ "metaData" ] == { });
metaData = input.metaData or { };
};
in if requiredInput.isAppProvided then
Expand Down

0 comments on commit 4f05ef6

Please sign in to comment.