Skip to content

Make the charon spec a proper module #78

Closed

Description

@shlevy

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.

Activity

  1. shlevy commented on Jul 29, 2013

    @shlevy
    MemberAuthor

    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.

  2. added 2 commits that reference this issue on May 14, 2014
    67e7f71
    604d489
  3. added a commit that references this issue on Jul 8, 2014
    3cd74d8
  4. copumpkin commented on Aug 30, 2014

    @copumpkin
    Member

    👍 yes please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions