docs: update docs for exports

This commit is contained in:
Johannes Kirschbauer
2025-08-14 18:01:19 +02:00
parent 90c7951704
commit a82ecbcbff

View File

@@ -635,14 +635,23 @@ in
exports = mkOption { exports = mkOption {
description = '' description = ''
This services exports. This services exports.
Gets merged with all other services exports Gets merged with all other services exports.
Final value (merged and evaluated with other services) available as `exports` in the arguments of this module. Exports are used to share and expose information between instances.
Define exports in the [`perInstance`](#perInstance) or [`perMachine`](#perMachine) scope.
Accessing the exports:
```nix ```nix
{ exports, ... }: { { exports, ... }: {
_class = "clan.service"; _class = "clan.service";
# ... # ...
roles.peer.perInstance = { exports, ...}: { ...};
# ...
perMachine = { exports, ...}: { ...};
} }
``` ```
''; '';