You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, a charon network spec is an ad-hoc system on top of the nixpkgs module library: each machine is a NixOS module, resources are modules with their own options, and some aspects (such as machine/resource names and the 'network' attribute) are not managed by the module system at all. It would probably be cleaner to have the spec itself simply be a module, where machines is an option whose type is attrsOf optionSet, resources.s3Buckets is an option whose type is attrs.Of optionSet, network.description is an option whose type is string, etc. We'd have to set the options attribute of the machines option to contain any options defined in NixOS modules that we care about, but since options is merged when an option is defined in multiple places, it should be possible to do this modularly.
The major benefit to this is that it will allow modular configuration at the network level (i.e. all of the benefits of NixOS being modular applied to configuring the network as a whole). For example, suppose we wanted to deploy some RabbitMQ queues as part of a deployment. We could create a module that specifies the options rabbitmq.queueCount and rabbitmq.instanceType, and then the module could based on the configuration values of those options spin up the appropriate number of queues(possibly 0) of the right instance type (perhaps this example would be better done with rabbitmq.queues.{name}.whatever, this is just meant for illustration). Now any network that wants some rabbitmq queues can just set those options in the network configuration appropriately. As another example, suppose we want to include some NixOS module in all machines of an instance. This is straightforward with a modular setup, but requires manual modification of each existing machine in the current setup.
Another benefit, which is more a matter of taste, is elegance/simplicity. Currently we have an ad-hoc library on top of the module system, when the module system really has all of the functionality we need.
Activity
shlevy commentedon Jul 29, 2013
The major benefit to this is that it will allow modular configuration at the network level (i.e. all of the benefits of NixOS being modular applied to configuring the network as a whole). For example, suppose we wanted to deploy some RabbitMQ queues as part of a deployment. We could create a module that specifies the options
rabbitmq.queueCountandrabbitmq.instanceType, and then the module could based on the configuration values of those options spin up the appropriate number of queues(possibly 0) of the right instance type (perhaps this example would be better done withrabbitmq.queues.{name}.whatever, this is just meant for illustration). Now any network that wants some rabbitmq queues can just set those options in the network configuration appropriately. As another example, suppose we want to include some NixOS module in all machines of an instance. This is straightforward with a modular setup, but requires manual modification of each existing machine in the current setup.Another benefit, which is more a matter of taste, is elegance/simplicity. Currently we have an ad-hoc library on top of the module system, when the module system really has all of the functionality we need.
Make it possible to define modular deployments.
Make it possible to define modular deployments.
Make it possible to define modular deployments.
copumpkin commentedon Aug 30, 2014
👍 yes please