clanServices: add flake level exports

This commit is contained in:
Johannes Kirschbauer
2025-07-01 16:54:19 +02:00
parent 29a2103aab
commit d10fe7a8ee
10 changed files with 373 additions and 32 deletions

View File

@@ -67,6 +67,41 @@ in
'';
};
# TODO: make this writable by moving the options from inventoryClass into clan.
exports = lib.mkOption {
readOnly = true;
};
exportsModule = lib.mkOption {
type = types.deferredModule;
# can be set only once
readOnly = true;
description = ''
A module that is used to define the module of flake level exports -
such as 'exports.machines.<name>' and 'exports.instances.<name>'
Example:
```nix
{
options.vars.generators = lib.mkOption {
type = lib.types.attrsOf (
lib.types.submoduleWith {
modules = [
{
options.script = lib.mkOption { type = lib.types.str; };
}
];
}
);
default = { };
};
}
```
'';
};
specialArgs = lib.mkOption {
type = types.attrsOf types.raw;
default = { };