I do something similar, but instead of a script with a bunch of `defaults write`, Ansible has an osx_defaults module. https://docs.ansible.com/ansible/latest/collections/communit...
The built-in options are listed in the modules docs starting here: https://daiderd.com/nix-darwin/manual/index.html#opt-system....
but you can also define custom ones without writing new modules via CustomPreferences and CustomSystemPreferences: https://daiderd.com/nix-darwin/manual/index.html#opt-system....
I track all of my `defaults` settings (aside from power management) in version control this way on my work machine. :)