If not, then you need to make changes to your syntax because extraOptions must be a JSON value. You can see how to declare it correctly in the search-nixos example.
Looks like you have declared extraOptions.gui in two places. Maybe it is on two different lines in configuration.nix or you are importing another .nix which contains another extraOptions.gui declaration.
No, I have not declared extraOptions.gui in two places; it’s just that I have to put something in extraOptions and I have to put something else in extraOptions.gui.