Merge pull request 'clanModules/importer: Init importer inventory module' (#2440) from kenji/clan-core:kenji-clan-modules/importer into main

This commit is contained in:
clan-bot
2024-11-19 13:06:37 +00:00
5 changed files with 34 additions and 0 deletions

View File

@@ -13,6 +13,7 @@
golem-provider = ./golem-provider; golem-provider = ./golem-provider;
heisenbridge = ./heisenbridge; heisenbridge = ./heisenbridge;
iwd = ./iwd; iwd = ./iwd;
importer = ./importer;
localbackup = ./localbackup; localbackup = ./localbackup;
localsend = ./localsend; localsend = ./localsend;
matrix-synapse = ./matrix-synapse; matrix-synapse = ./matrix-synapse;

View File

@@ -0,0 +1,27 @@
---
description = "Convenient, structured module imports for hosts."
categories = ["Utility"]
features = [ "inventory" ]
---
The importer module allows users to configure importing modules in a flexible and structured way.
It exposes the `extraModules` functionality of the inventory, without any added configuration.
## Usage:
```nix
inventory.services = {
importer.base = {
roles.default.tags = [ "all" ];
roles.default.extraModules = [ "modules/base.nix" ];
};
importer.zone1 = {
roles.default.tags = [ "zone1" ];
roles.default.extraModules = [ "modules/zone1.nix" ];
};
};
```
This will import the module `modules/base.nix` to all machines that have the `all` tag,
which by default is every machine managed by the clan.
And also import for all machines tagged with `zone1` the module at `modules/zone1.nix`.

View File

@@ -0,0 +1,4 @@
# Dont import this file
# It is only here for backwards compatibility.
# Dont author new modules with this file.
{ }

View File

@@ -0,0 +1 @@
{ }

View File

@@ -79,6 +79,7 @@ nav:
- reference/clanModules/heisenbridge.md - reference/clanModules/heisenbridge.md
- reference/clanModules/index.md - reference/clanModules/index.md
- reference/clanModules/iwd.md - reference/clanModules/iwd.md
- reference/clanModules/importer.md
- reference/clanModules/localbackup.md - reference/clanModules/localbackup.md
- reference/clanModules/localsend.md - reference/clanModules/localsend.md
- reference/clanModules/machine-id.md - reference/clanModules/machine-id.md