- add top-level option `clanImports` to clanCore
- clanImports can be set and checked as any other option
- buildClan resolves the clanImports from the settings.json before calling evalModules to prevent infinite recursions
- new endpoint PUT machines/{name}/schema to allow getting the schema for a specific list of imports
- to retrieve the currently imported modules, cimply do a GET or PU on machines/{name}/config which will return `clanImports` as part of the config
Still missing: get list of available modules
17 lines
530 B
Nix
17 lines
530 B
Nix
{ lib
|
|
, ...
|
|
}: {
|
|
/*
|
|
Declaring imports inside the module system does not trigger an infinite
|
|
recursion in this case because buildClan generates the imports from the
|
|
settings.json file before calling out to evalModules.
|
|
*/
|
|
options.clanImports = lib.mkOption {
|
|
type = lib.types.listOf lib.types.str;
|
|
description = ''
|
|
A list of imported module names imported from clan-core.clanModules.<name>
|
|
The buildClan function will automatically import these modules for the current machine.
|
|
'';
|
|
};
|
|
}
|