Skip to content

Commit 76f25ad

Browse files
committed
Update README.md
1 parent 9edb178 commit 76f25ad

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,19 @@ e.g. inside your `flake.nix` file:
364364
When the `age.secrets` attribute set contains a secret, the `agenix` NixOS module will later automatically decrypt and mount that secret under the default path `/run/agenix/secret1`.
365365
Here the `secret1.age` file becomes part of your NixOS deployment, i.e. moves into the Nix store.
366366

367+
You may also generate them based on the `secrets.nix` file with no extra options:
368+
```nix
369+
{ lib, ... }:
370+
371+
{
372+
age.secrets =
373+
lib.genAttrs (lib.map (lib.removeSuffix ".age") (lib.attrNames (import ./secrets.nix)))
374+
(name: {
375+
file = ./${name}.age;
376+
});
377+
}
378+
```
379+
367380
6. Reference the secrets' mount path in your config:
368381
```nix
369382
{

0 commit comments

Comments
 (0)