mirror of
https://github.com/ryantm/agenix.git
synced 2024-12-22 15:48:30 +03:00
doc: improve tutorial by showing how to use the secret path
This commit is contained in:
parent
d13c6d3bb7
commit
5d802d251c
1 changed files with 11 additions and 2 deletions
13
README.md
13
README.md
|
@ -226,9 +226,18 @@ but, if you want to (change the system based on your system):
|
|||
```
|
||||
5. Add secret to a NixOS module config:
|
||||
```nix
|
||||
age.secrets.secret1.file = ../secrets/secret1.age;
|
||||
{
|
||||
age.secrets.secret1.file = ../secrets/secret1.age;
|
||||
}
|
||||
```
|
||||
6. NixOS rebuild or use your deployment tool like usual.
|
||||
6. Use the secret in your config:
|
||||
```nix
|
||||
users.users.user1 = {
|
||||
isNormalUser = true;
|
||||
passwordFile = config.age.secrets.secret1.path;
|
||||
};
|
||||
```
|
||||
7. NixOS rebuild or use your deployment tool like usual.
|
||||
|
||||
The secret will be decrypted to the value of `config.age.secrets.secret1.path` (`/run/agenix/secret1` by default). For per-secret options controlling ownership etc, see [modules/age.nix](modules/age.nix).
|
||||
|
||||
|
|
Loading…
Reference in a new issue