Compare commits

..

3 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
Jörg Thalheim
20ad968d04 waypipe: disable gpu for now 2025-07-16 11:55:15 +02:00
4 changed files with 60 additions and 11 deletions

View File

@@ -39,7 +39,7 @@ in
};
perInstance =
{ instanceName, settings, ... }:
{ settings, ... }:
{
nixosModule =
{ pkgs, config, ... }:
@@ -86,7 +86,7 @@ in
# service to generate the environment file containing all secrets, as
# expected by the nixos NetworkManager-ensure-profile service
systemd.services."NetworkManager-setup-secrets-${instanceName}" = {
systemd.services.NetworkManager-setup-secrets = {
description = "Generate wifi secrets for NetworkManager";
requiredBy = [ "NetworkManager-ensure-profiles.service" ];
partOf = [ "NetworkManager-ensure-profiles.service" ];

View File

@@ -7,16 +7,8 @@
inventory = {
machines.test = { };
machines.second = { };
instances = {
wg-test-all = {
module.name = "@clan/wifi";
module.input = "self";
roles.default.tags.all = { };
roles.default.settings.networks.all = { };
};
wg-test-one = {
module.name = "@clan/wifi";
module.input = "self";

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;
}