I’m building a nix configuration for our servers and clients (IoT) devices. For secrets, I’m using nix-sops which works great. Some of the secrets need to be shared between (on of) the servers and a client. I’m wondering what is the best approach to do this.
Currently, I have a separate secrets.yaml file for each host (servers and clients) to store the secrets. Now I want to setup Mosquitto (MQTT server) and have an account for each client on it. I’m thinking to create a password in the secrets.yaml file for each client. Then for the server I collect all the passwords and generate the pwfile and aclfile for Mosquitto. I did something similar for Wireguard but then I only had to collect the public keys that were stored in regular nix files.
Is this a common pattern for sharing passwords between hosts, are there any examples or better ways to achieve this?