Skip to content

Commit

Permalink
docs: Update notes about sops
Browse files Browse the repository at this point in the history
  • Loading branch information
britter committed Aug 29, 2024
1 parent fd92f21 commit ccecf46
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,17 @@ nix flake show <flake url>
- 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
Expand Down

0 comments on commit ccecf46

Please sign in to comment.