This terraform module builds and publishes custom NixOS Google Cloud images.
Because this module uses the "external" provider it needs the following executables to be in the path to work properly:
- bash
- nix
readlink -f
(busybox or coreutils)
NixOS images are built at Terraform plan time. This can make the plan quite slow.
Building the image doesn't yield any output, unless the build is interrupted or failed.
When a new image is published, the old-one gets removed. This potentially
introduces a race-condition where other targets are trying to create new
instances with the old image. To reduce the race window, create_before_destroy
is being used. See
hashicorp/terraform#15485 for related discussions.
Only x86_64-linux is currently supported.
Name | Version |
---|---|
external | n/a |
n/a |
Name | Description | Type | Default | Required |
---|---|---|---|---|
NIX_PATH | Allow to pass custom NIX_PATH. Ignored if - or empty. |
string |
"-" |
no |
bucket_name | Bucket where to store the image | any |
n/a | yes |
gcp_project_id | The ID of the project in which the resource belongs. If it is not provided, the provider project is used. | string |
"" |
no |
licenses | A list of license URIs to apply to this image. Changing this forces a new resource to be created. | list(string) |
[ |
no |
nixos_config | Path to a nixos configuration.nix file | any |
n/a | yes |
Name | Description |
---|---|
NIX_PATH | n/a |
self_link | n/a |