Set up a host's TPM identity
- On the host, as root, generate the identity:
install -d -m 700 /var/lib/sops-nix
nix shell nixpkgs#age-plugin-tpm -c age-plugin-tpm --generate -o /var/lib/sops-nix/key.txt
- From the repo, save the host's recipient:
mkdir -p keys/hosts/<host>
ssh root@<host>.lan.cmu.edu 'nix shell nixpkgs#age-plugin-tpm -c age-plugin-tpm -y /var/lib/sops-nix/key.txt' > keys/hosts/<host>/age.pub
- In the devenv shell, re-encrypt each existing secrets file to the new recipient list:
sops updatekeys secrets/<file>.yaml
- Commit and deploy the host.