diff --git a/README.md b/README.md index bdfb74c..5b03c41 100644 --- a/README.md +++ b/README.md @@ -92,21 +92,17 @@ nix flake show - https://github.com/getsops/sops - https://www.youtube.com/watch?v=G5f6GC7SnhU -**Generating a key from SSH key** +** Adding a new host -```shell -# generate new key at ~/.config/sops/age/keys.txt from private ssh key at ~/.ssh/private -$ nix run nixpkgs#ssh-to-age -- -private-key -i ~/.ssh/private > ~/.config/sops/age/keys.txt -``` - -**Getting the public key for an existing age key** +- Generate SSH key for the host using `ssh-key-gen` +- Convert the public key to age ```shell -# get a public key of ~/.config/sops/age/keys.txt -nix shell nixpkgs#age --command age-keygen -y ~/.config/sops/age/keys.txt +nix run nixpkgs#ssh-to-age -- -i ~/.ssh/key.pub ``` -**Editing a sops file** +- Add an entry to `.sops.yaml` for that host +- Create the secrets file ```shell nix run nixpkgs#sops -- path/to/secrets.yaml