Saving preset on configuration changes

Please correct me, if this is already possible:

I am using nix to save my apps' settings. I configured this for BTT as well - however, it is a bit too manual:

BTT loads a configuration from "~/.btt_autoload_preset.json".
It would be great, if changes done to the configuration via the GUI would be persisted here as well!

Currently I am exporting my preset in a file and copy the content to "~/.btt_autoload_preset.json" manually, so nix picks them up in the next git commit. The nix part is not important here - if somebody is interested I can explain it. I would like the preset-export-copy-paste, which I could, if BTT not only reads from ".btt_autoload_preset.json" but writes to this file as well.
Is this possible?

BTT can not export on every change. However you can trigger exporting manually via apple script if you want:

tell application "BetterTouchTool" to export_preset "PresetName" outputPath "~/Documents/test.bttpreset"  with includeSettings

You can call this via osascript from command line if required. Exporting is a relatively expensive operation, so it shouldn't be done too often automatically.

Wow, thanks for the fast reply! Ok, I understand now why auto-exporting wouldn't be good. Thanks for the apple script!