2010-11-24 23:00:21 +00:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
with pkgs.lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
2011-04-29 12:28:43 +01:00
|
|
|
|
|
|
|
deployment.targetEnv = mkOption {
|
|
|
|
default = "none";
|
|
|
|
example = "ec2";
|
|
|
|
description = ''
|
|
|
|
This option specifies the type of the environment in which the
|
|
|
|
machine is to be deployed by
|
|
|
|
<command>nixos-deploy-network</command>. Currently, it can
|
|
|
|
have the following values. <literal>"none"</literal> means
|
|
|
|
deploying to a pre-existing physical or virtual NixOS machine,
|
|
|
|
reachable via SSH under the hostname or IP address specified
|
|
|
|
in <option>deployment.targetHost</option>.
|
|
|
|
<literal>"ec2"</literal> means that a virtual machine should be
|
|
|
|
instantiated in an Amazon EC2-compatible cloud environment
|
|
|
|
(see <option>deployment.ec2.*</option>).
|
|
|
|
<literal>"adhoc-cloud"</literal> means that a virtual machine
|
|
|
|
should be instantiated by executing certain commands via SSH
|
|
|
|
on a cloud controller machine (see
|
|
|
|
<option>deployment.adhoc.*</option>). This is primarily
|
|
|
|
useful for debugging <command>nixos-deploy-network</command>.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2010-12-14 13:36:54 +00:00
|
|
|
deployment.targetHost = mkOption {
|
|
|
|
default = config.networking.hostName;
|
|
|
|
description = ''
|
2011-04-29 12:28:43 +01:00
|
|
|
This option specifies a hostname or IP address which can be
|
|
|
|
used by <command>nixos-deploy-network</command> to execute
|
|
|
|
remote deployment operations.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
# EC2/Nova/Eucalyptus-specific options.
|
|
|
|
|
2011-06-16 15:14:50 +01:00
|
|
|
deployment.ec2.type = mkOption {
|
|
|
|
default = "ec2";
|
|
|
|
example = "nova";
|
|
|
|
description = ''
|
|
|
|
Specifies the type of cloud. This affects the machine
|
|
|
|
configuration. Current values are <literal>"ec2"</literal>
|
|
|
|
and <literal>"nova"</literal>.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2011-05-12 16:30:56 +01:00
|
|
|
deployment.ec2.controller = mkOption {
|
|
|
|
example = https://ec2.eu-west-1.amazonaws.com:443/;
|
2011-04-29 12:28:43 +01:00
|
|
|
description = ''
|
2011-05-12 16:30:56 +01:00
|
|
|
URI of an Amazon EC2-compatible cloud controller web service,
|
|
|
|
used to create and manage virtual machines.
|
2011-04-29 12:28:43 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
deployment.ec2.ami = mkOption {
|
|
|
|
example = "ami-ecb49e98";
|
|
|
|
description = ''
|
|
|
|
EC2 identifier of the AMI disk image used in the virtual
|
|
|
|
machine. This must be a NixOS image providing SSH access.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
deployment.ec2.instanceType = mkOption {
|
|
|
|
default = "m1.small";
|
|
|
|
example = "m1.large";
|
|
|
|
description = ''
|
|
|
|
EC2 instance type. See <link
|
|
|
|
xlink:href='http://aws.amazon.com/ec2/instance-types/'/> for a
|
|
|
|
list of valid Amazon EC2 instance types.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2011-05-12 16:30:56 +01:00
|
|
|
deployment.ec2.keyPair = mkOption {
|
|
|
|
example = "my-keypair";
|
|
|
|
description = ''
|
|
|
|
Name of the SSH key pair to be used to communicate securely
|
|
|
|
with the instance. Key pairs can be created using the
|
|
|
|
<command>ec2-add-keypair</command> command.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2011-04-29 12:28:43 +01:00
|
|
|
# Ad hoc cloud options.
|
|
|
|
|
|
|
|
deployment.adhoc.controller = mkOption {
|
2011-04-29 14:24:24 +01:00
|
|
|
example = "cloud.example.org";
|
2011-04-29 12:28:43 +01:00
|
|
|
description = ''
|
|
|
|
Hostname or IP addres of the machine to which
|
|
|
|
<command>nixos-deploy-network</command> should connect (via
|
|
|
|
SSH) to execute commands to start VMs or query their status.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2011-05-08 21:51:40 +01:00
|
|
|
deployment.adhoc.createVMCommand = mkOption {
|
2011-04-29 12:28:43 +01:00
|
|
|
default = "create-vm";
|
|
|
|
description = ''
|
|
|
|
Remote command to create a NixOS virtual machine. It should
|
|
|
|
print an identifier denoting the VM on standard output.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2011-05-10 14:12:35 +01:00
|
|
|
deployment.adhoc.destroyVMCommand = mkOption {
|
|
|
|
default = "destroy-vm";
|
|
|
|
description = ''
|
|
|
|
Remote command to destroy a previously created NixOS virtual
|
|
|
|
machine.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2011-04-29 12:28:43 +01:00
|
|
|
deployment.adhoc.queryVMCommand = mkOption {
|
|
|
|
default = "query-vm";
|
|
|
|
description = ''
|
|
|
|
Remote command to query information about a previously created
|
|
|
|
NixOS virtual machine. It should print the IPv6 address of
|
|
|
|
the VM on standard output.
|
2010-12-14 13:36:54 +00:00
|
|
|
'';
|
2010-11-24 23:00:21 +00:00
|
|
|
};
|
2011-04-29 12:28:43 +01:00
|
|
|
|
2010-11-24 23:00:21 +00:00
|
|
|
};
|
|
|
|
}
|