| 19 Feb 2025 |
pcarrier | defaults = { foo = lib.mkOption { … } };
host = { foo = bar; }
doesn't work right?
| 13:00:56 |
pcarrier | ah, got it, thanks | 13:30:27 |
| @thesimplekid:matrix.org left the room. | 14:49:23 |
| sako -w- joined the room. | 18:13:40 |
pcarrier | Been stuck for a while with this error: https://gist.github.com/pcarrier/bc0173d20106cd178707f1955a1dafd8 | 19:19:35 |
pcarrier | Any ideas would be much appreciated | 19:19:40 |
gmacon | Looks like you need enable = config.roles ? etcd; since on the non-etcd hosts, config.roles will be an attrset that does not contain an etcd key, so you can't get the value of that key. Another option would be to ensure that roles always contains every possible role, but set to false for the roles this host doesn't have. | 20:18:22 |
pcarrier | well I thought I did exactly that through its default value | 20:19:22 |
pcarrier | options = {
roles = mkOption {
type = types.attrsOf types.bool;
default = {
bastion = false;
spawner = false;
etcd = false;
webserver = false;
};
};
};
| 20:20:05 |