| 22 Feb 2024 |
Zhaofeng Li | In reply to @ma27:nicht-so.sexy fwiw what I've effectively done in my to-be-published solution is to expose nodes.<name>.os & nodes.<name>.configuration (I wanted to have deployment-wide modules, i.e. modules that are able to manipulate many machines). The latter's option type is generated by a function that takes a merge function and provides a type for that. The "merge function" can be something like nixos.lib.nixosSystem (or the nix-darwin equivalent), depending on what os looks like. The structure in nodes isn't mapped to config.system.build.toplevel, but left as-is to allow any part of any node to be evaluated with nix eval. Another module (when using it with flake-parts) fills nixosConfigurations/etc. with config.system.build.toplevel to allow nixos-rebuild to work with that. Interesting, the os key sounds like what I have in mind. I assume eval.nix would inject os for the deployment-wide modules to consume? | 17:23:41 |
raitobezarius | I just find it weird it's an attribute set inside the system that modifies the loaded modules for the evaluation | 17:35:50 |
raitobezarius | That means that you kinda introspect the system before calling lib.evalModules on it with the appropriate modules | 17:36:02 |
raitobezarius | But I guess, this could be acceptable | 17:36:06 |
raitobezarius | and how do you see configuring the dispatch for the switch case on the os attribute Zhaofeng Li ? | 17:37:09 |
Zhaofeng Li | There would be a registry attrset with definitions for each target type, and the os attribute can either be a string (in which case it will look up the registry) or an explicit target definition | 17:40:45 |
Zhaofeng Li | In reply to @raitobezarius:matrix.org I just find it weird it's an attribute set inside the system that modifies the loaded modules for the evaluation Yeah, but it's mostly for backwards compatibility, newer configs should provide each node already wrapped | 17:42:11 |
raitobezarius | what does already wrapped means | 17:42:25 |
raitobezarius | because I'd imagine that | 17:42:28 |
raitobezarius | targets.nixos cfg = cfg // { os = "nixos"; } ? | 17:42:46 |
raitobezarius | or would you imagine | 17:42:52 |
raitobezarius | targets.nixos cfg = { _type = "nixos"; module = cfg; ... } ? | 17:43:01 |
raitobezarius | In reply to @zhaofeng:zhaofeng.li There would be a registry attrset with definitions for each target type, and the os attribute can either be a string (in which case it will look up the registry) or an explicit target definition OK, how do you see the definition for activation ? | 17:43:13 |
raitobezarius | right now, you can do colmena apply dry-activate, etc. | 17:43:28 |
raitobezarius | how would we translate this in the registry configuration module | 17:43:37 |
Zhaofeng Li | In reply to @raitobezarius:matrix.org
targets.nixos cfg = { _type = "nixos"; module = cfg; ... } ? This, which is closer to ma27 's model | 17:43:42 |
ma27 | In reply to @zhaofeng:zhaofeng.li Interesting, the os key sounds like what I have in mind. I assume eval.nix would inject os for the deployment-wide modules to consume? not sure if I have done that already (the current draft is very much oriented on what I needed), but it would be trivial. | 17:43:54 |
raitobezarius | In reply to @zhaofeng:zhaofeng.li This, which is closer to ma27 's model yeah so I agree with this | 17:44:06 |
raitobezarius | I like this one too | 17:44:14 |
raitobezarius | because low level users can do much more with it | 17:44:19 |
raitobezarius | so I gather that colmena upstream would be interested in this sort of features | 17:44:35 |
raitobezarius | so it may make sense just to send PRs towards it (?) | 17:44:41 |
Zhaofeng Li | In reply to @raitobezarius:matrix.org OK, how do you see the definition for activation ? I think a good start would be to just have the activation commands, but it could accept a script with a defined interface | 17:46:32 |
raitobezarius | you mean | 17:46:48 |
raitobezarius | registry.nixosSystems.activation.dry-activate = "switch-to-configuration dry-activate"; or something like that? | 17:47:06 |
Zhaofeng Li | Yeah, something like that | 17:47:22 |
raitobezarius | that makes sense to me | 17:47:38 |
| 23 Feb 2024 |
| Jane Jasperous left the room. | 16:35:34 |
| 25 Feb 2024 |
| Frédéric Christ joined the room. | 10:21:20 |
| polygon (she/it) - migrating to @polygon:catgirl.cloud ⚡️ changed their display name from polygon (she/it) ⚡️ to polygon (she/it) - migrating to @polygon:catgirl.cloud ⚡️. | 22:08:53 |