Compare commits

...

2 Commits

Author SHA1 Message Date
Johannes Kirschbauer
4cfe69d7f5 WIP 2025-07-16 12:03:25 +02:00
Jörg Thalheim
1c5257f5fe waypipe: disable gpu for now 2025-07-16 12:03:25 +02:00
2 changed files with 58 additions and 1 deletions

View File

@@ -72,12 +72,19 @@
clan = {
meta.name = "clan-core";
inventory = {
services = { };
machines = {
"test-darwin-machine" = {
machineClass = "darwin";
};
};
instances = {
users = {
roles.default.tags."all" = { };
roles.default.settings = {
user = "root";
};
};
};
};
};
systems = import systems;

View File

@@ -418,6 +418,29 @@ in
```
'';
};
options.assertions = mkOption {
default = { };
description = ''
Assertions for the instance.
This is a set of assertions that should be checked during the evaluation of the instance.
If any assertion fails, an error is thrown.
Example:
```nix
{
assertions = {
timeout = {
assertion = "settings.timeout > 0";
message = "Timeout must be greater than 0";
};
};
}
```
'';
type = types.attrsOf types.raw;
};
options.nixosModule = mkOption {
type = types.deferredModule;
default = { };
@@ -553,6 +576,15 @@ in
```
'';
};
options.assertions = mkOption {
default = { };
description = ''
Assertions for the machine.
See instance assertions for more information.
'';
type = types.attrsOf types.raw;
};
options.nixosModule = mkOption {
type = types.deferredModule;
default = { };
@@ -877,5 +909,23 @@ in
}
) config.result.allMachines;
};
debug = mkOption {
default = { };
# result.allRoles.default.allInstances.users.allMachines.flash-installer
};
};
config.result.assertions = lib.concatMapAttrs (
roleName: role:
lib.concatMapAttrs (
instanceName: instance:
lib.concatMapAttrs (
machineName: machine:
lib.mapAttrs' (assertion_id: value: {
name = "${assertion_id} (instance=${instanceName}; role=${roleName}; machine=${machineName};)";
inherit value;
}) machine.assertions
) instance.allMachines
) role.allInstances
) config.result.allRoles;
}