How to change browser specific settings?

I’m new to NixOS, but I managed to setup a NixOS flake and Home Manager as a module in the flake. I’m diving into configuring apps through Home Manager now.

My starting point is my Brave browser that I want to configure, but I’m still a bit confused on how to declare Brave specific settings. I can’t find any resource on this. I checked NixOS options and packages, Home Manager options, flag options and the Chrome policy lists (which should be usable by Chromium based browsers from what I read?).

Some of the settings I want to change:

  • Create or join a sync chain
  • Import and sync bookmarks if Brave Sync is not to my liking
  • Set custom search engines, i.e. one that searches YouTube when typing yt + space in the address bar
  • Alter new tab behavior
  • Brave colors to Dark
  • Show bookmarks bar to Always
  • Use wide address bar to true
  • Use vertical tabs to true
  • Disable Brave Rewards to true

If there is no NixOS module or Home-Manager module, then those are a no-go unless you wanted to make one. You could wrap the executable with whatever flags you wanted but I’m not sure whether that covers all of your wants.

download lxappearance
also darkreader browser extinction .

dark mode isnt something good for eyes try to get touch with sunlight at daytime also with device .
sorry for bad english

It’s a shame something so vital like a browser can’t be configured declaratively.

I’m thinking of backing up my entire .config/Brave Software directory somewhere NixOS is able to pick it up from.

Well, it can be. Turns out, the chromium module is designed in such a way to support many chromium-based browsers, including Brave. It’s odd that this isn’t picked up in the documentation.

That is what I was using. It is mentioned here. I also tried with home manager, which has a few more options, but as far as I can see these options are too limited for the things I want to change.

Well I don’t think command line arguments cover my demands anyway.

Well, the best course here is probably to extend the module yourself or open some feature requests. Though just from a cursory glance at how Brave handles those settings, I’m not sure it would be fun. Seems like they cram just about everything into one gargantuan json file which, if you managed it with Nix, would be read-only. That could cause problems if Brave doesn’t assume defaults for missing values or otherwise fails to handle the case of an unwritable config file. And the only way to work around those (if they occur) would be to include the setting in question or fix it upstream. Frankly, it probably isn’t worth messing with unless they redesign things to be a little less insane more manageable.

1 Like

Yeah you’re right. Thanks for your clear conclusion.

I come from a Windows + Chrome combo, and really like Chromium based browsers. I was hoping Brave would be a right mix between familiar looks and feel, and privacy, while being able to declare all my settings.

I’m still open to using a new browser, but I think Chromium based browsers are off the table for now. I was hoping to avoid Firefox, but I guess it has a lot more options when it comes to declaring settings.

How do other people do it? Firefox must not be be the only true contender to give a more fine grained control through Nix?

Something with user-written config files like qutebrowser comes to mind and is probably a good solution (my only issue with non-chromium/firefox is finding an acceptable syncing solution). Personally, I use brave’s sync chain and manually update untracked settings. It’s actually a little annoying at times, particularly with vimium, and it’s in pretty stark contrast to virtually everything else, which I manage with Nix.