mirror of
https://github.com/Superredstone/nixos.git
synced 2026-03-07 12:28:02 +01:00
docs(secrets): add secrets
This commit is contained in:
@@ -20,7 +20,8 @@ git clone git@github.com:Superredstone/nixos.git ~/.nixos && cd .nixos
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
5) Switch to the new configuration
|
5) Follow `secrets/README.md`
|
||||||
|
6) Switch to the new configuration
|
||||||
```bash
|
```bash
|
||||||
HOSTNAME=HOSTNAME just switch
|
HOSTNAME=HOSTNAME just switch
|
||||||
```
|
```
|
||||||
|
|||||||
21
secrets/README.md
Normal file
21
secrets/README.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Secrets
|
||||||
|
|
||||||
|
## Add a new machine
|
||||||
|
1) Obtain an age identity
|
||||||
|
```bash
|
||||||
|
nix run nixpkgs#ssh-to-age -- \
|
||||||
|
-private-key \
|
||||||
|
-i $HOME/.ssh/id_ed25519 \
|
||||||
|
-o $HOME/.config/sops/age/keys.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
2) Obtain age recipient for the machine
|
||||||
|
```bash
|
||||||
|
cat /etc/ssh/ssh_host_ed25519_key.pub | nix run nixpkgs#ssh-to-age | wl-copy
|
||||||
|
```
|
||||||
|
|
||||||
|
3) Paste obtained key into `.sops.yaml`
|
||||||
|
4) Re-encrypt old files
|
||||||
|
```bash
|
||||||
|
sops updatekeys secrets/default.sops.yaml
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user