move smb automount secrets to agenix
This commit is contained in:
@@ -20,3 +20,36 @@ NixOS configuration using a dendritic structure — `flake.nix` at the root, wit
|
||||
```bash
|
||||
sudo nixos-rebuild switch --flake .#nixos
|
||||
```
|
||||
|
||||
## SMB share secrets (agenix)
|
||||
|
||||
SMB automount is configured in `modules/hosts/nixos.nix` and activates once
|
||||
`secrets/smb-credentials.age` exists.
|
||||
|
||||
1. Edit recipients in `secrets/secrets.nix` if needed.
|
||||
2. Create the encrypted secret (using the host SSH private key via sudo):
|
||||
|
||||
```bash
|
||||
sudo env RULES=secrets/secrets.nix nix run github:ryantm/agenix -- -e secrets/smb-credentials.age -i /etc/ssh/ssh_host_ed25519_key
|
||||
```
|
||||
|
||||
Use this content:
|
||||
|
||||
```text
|
||||
username=YOUR_SMB_USER
|
||||
password=YOUR_SMB_PASSWORD
|
||||
# optional
|
||||
# domain=WORKGROUP
|
||||
```
|
||||
|
||||
Configured shares mirror your Endeavour setup:
|
||||
|
||||
- `//192.168.1.102/data` → `/mnt/unraid-data`
|
||||
- `//192.168.1.102/appdata` → `/mnt/unraid-appdata`
|
||||
|
||||
Then apply:
|
||||
|
||||
```bash
|
||||
sudo nixos-rebuild switch --flake .#nixos
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user