extraModules: soft deprecation for string extraModules
This commit is contained in:
@@ -850,7 +850,11 @@ in
|
|||||||
instanceRes.nixosModule
|
instanceRes.nixosModule
|
||||||
]
|
]
|
||||||
++ (map (
|
++ (map (
|
||||||
s: if builtins.typeOf s == "string" then "${directory}/${s}" else s
|
s:
|
||||||
|
if builtins.typeOf s == "string" then
|
||||||
|
lib.warn "String types for 'extraModules' will be deprecated - ${s}" "${directory}/${s}"
|
||||||
|
else
|
||||||
|
lib.setDefaultModuleLocation "via inventory.instances.${instanceName}.roles.${roleName}" s
|
||||||
) instanceCfg.roles.${roleName}.extraModules);
|
) instanceCfg.roles.${roleName}.extraModules);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,12 +44,6 @@ in
|
|||||||
description = ''
|
description = ''
|
||||||
List of additionally imported `.nix` expressions.
|
List of additionally imported `.nix` expressions.
|
||||||
|
|
||||||
Supported types:
|
|
||||||
|
|
||||||
- **Strings**: Interpreted relative to the 'directory' passed to `lib.clan`.
|
|
||||||
- **Paths**: should be relative to the current file.
|
|
||||||
- **Any**: Nix expression must be serializable to JSON.
|
|
||||||
|
|
||||||
!!! Note
|
!!! Note
|
||||||
**The import only happens if the machine is part of the service or role.**
|
**The import only happens if the machine is part of the service or role.**
|
||||||
|
|
||||||
@@ -74,7 +68,7 @@ in
|
|||||||
```
|
```
|
||||||
'';
|
'';
|
||||||
default = [ ];
|
default = [ ];
|
||||||
type = types.listOf types.deferredModule;
|
type = types.listOf types.raw;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class InventoryInstanceRoleMachine(TypedDict):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
InventoryInstanceRoleExtramodulesType = list[Unknown]
|
InventoryInstanceRoleExtramodulesType = list[dict[str, Any] | list[Any] | bool | float | int | str | None]
|
||||||
InventoryInstanceRoleMachinesType = dict[str, InventoryInstanceRoleMachine]
|
InventoryInstanceRoleMachinesType = dict[str, InventoryInstanceRoleMachine]
|
||||||
InventoryInstanceRoleSettingsType = Unknown
|
InventoryInstanceRoleSettingsType = Unknown
|
||||||
InventoryInstanceRoleTagsType = dict[str, Any] | list[str]
|
InventoryInstanceRoleTagsType = dict[str, Any] | list[str]
|
||||||
|
|||||||
Reference in New Issue
Block a user