Skip to content

Commit ae30bdd

Browse files
authored
Merge pull request #476 from marcocondrache/main
Add build_on_remote variable to all-in-one terraform module
2 parents eaeb75c + f4592f3 commit ae30bdd

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

terraform/all-in-one.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ module "deploy" {
2626
instance_id = local.ipv4
2727
# useful if something goes wrong
2828
# debug_logging = true
29+
# build the closure on the remote machine instead of locally
30+
# build_on_remote = true
2931
# script is below
3032
extra_files_script = "${path.module}/decrypt-ssh-secrets.sh"
3133
disk_encryption_key_scripts = [{
@@ -109,7 +111,7 @@ NixOS without relying on special_args.
109111
centralizing state in a single repository.
110112
- **Disadvantages**:
111113
- Deploying new machines requires tracking additional state. Every time
112-
Terraform updates the JSON file, youll need to commit these changes to your
114+
Terraform updates the JSON file, you'll need to commit these changes to your
113115
repository.
114116

115117
### Implementation
@@ -218,6 +220,7 @@ No resources.
218220
| <a name="input_no_reboot"></a> [no\_reboot](#input_no_reboot) | DEPRECATED: Use `phases` instead. Do not reboot after installation | `bool` | `false` | no |
219221
| <a name="input_phases"></a> [phases](#input_phases) | Phases to run. See `nixos-anywhere --help` for more information | `set(string)` | <pre>[<br> "kexec",<br> "disko",<br> "install",<br> "reboot"<br>]</pre> | no |
220222
| <a name="input_special_args"></a> [special\_args](#input_special_args) | A map exposed as NixOS's `specialArgs` thru a file. | `any` | `{}` | no |
223+
| <a name="input_build_on_remote"></a> [build\_on\_remote](#input_build_on_remote) | Build the closure on the remote machine instead of building it locally and copying it over | `bool` | `false` | no |
221224
| <a name="input_stop_after_disko"></a> [stop\_after\_disko](#input_stop_after_disko) | DEPRECATED: Use `phases` instead. Exit after disko formatting | `bool` | `false` | no |
222225
| <a name="input_target_host"></a> [target\_host](#input_target_host) | DNS host to deploy to | `string` | n/a | yes |
223226
| <a name="input_target_port"></a> [target\_port](#input_target_port) | SSH port used to connect to the target\_host after installing NixOS. If install\_port is not set than this port is also used before installing. | `number` | `22` | no |

terraform/all-in-one/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module "install" {
3636
phases = var.phases
3737
nixos_generate_config_path = var.nixos_generate_config_path
3838
nixos_facter_path = var.nixos_facter_path
39+
build_on_remote = var.build_on_remote
3940
# deprecated attributes
4041
stop_after_disko = var.stop_after_disko
4142
no_reboot = var.no_reboot

terraform/all-in-one/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,9 @@ variable "special_args" {
137137
default = {}
138138
description = "A map exposed as NixOS's `specialArgs` thru a file."
139139
}
140+
141+
variable "build_on_remote" {
142+
type = bool
143+
description = "Build the closure on the remote machine instead of building it locally and copying it over"
144+
default = false
145+
}

0 commit comments

Comments
 (0)