scan target server for ssh public key:
nix-shell -p ssh-to-age --run "ssh-keyscan 192.168.1.103 | ssh-to-age"
the output will be like: age1whateverblablaxyz...
add output to .sops.yaml config file according to sops-nix docs.
and update the repo:
sops updatekeys secrets/*.yaml # given the secrets are in subfolder 'secrets'
git add --all
git commit -m "udpated secrets"
git pushto update the input to the lastest version:
nix flake update --update-input nix-secretsthen nixos-rebuild etcetc...
I think it's best to have the secret bound to the ssh host key config and not a user.
this enables to configure secrets without having to have a user on the target machine that is 'secrets enabled'.