Multipurpose web servers. Managed via Nix.
Secrets are managed with sops-nix using age encryption derived from each server's SSH host key.
ssh-keyscan -p 2222 <server-ip> 2>/dev/null | grep ed25519 | ssh-to-agekeys:
- &<hostname> <age-public-key>
creation_rules:
- path_regex: modules/hosts/by_name/<hostname>/secrets\.yaml$
key_groups:
- age:
- *<hostname>sops modules/hosts/by_name/<hostname>/secrets.yamlThis opens an editor where you enter secrets in plaintext. On save, sops encrypts the file with the server's public key. Commit the encrypted file to the repository.
sops.secrets.my_secret.owner = "service-user";The decrypted secret is available at config.sops.secrets.my_secret.path.