Skip to content

Latest commit

 

History

History
 
 

google_image_nixos_custom

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

google_cloud_image_nixos

This terraform module builds and publishes custom NixOS Google Cloud images.

Runtime dependencies

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)

Known limitations

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.

Providers

Name Version
external n/a
google n/a

Inputs

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)
[
"https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"
]
no
nixos_config Path to a nixos configuration.nix file any n/a yes

Outputs

Name Description
NIX_PATH n/a
self_link n/a