mirror of
https://github.com/nix-community/nixos-anywhere.git
synced 2024-09-11 08:35:24 +03:00
terraform/install: support build_on_remote
This commit is contained in:
parent
b20ded671e
commit
38d8eea71f
@ -18,6 +18,8 @@ resource "null_resource" "nixos-remote" {
|
|||||||
target_host = var.target_host
|
target_host = var.target_host
|
||||||
extra_files_script = var.extra_files_script
|
extra_files_script = var.extra_files_script
|
||||||
no_reboot = var.no_reboot
|
no_reboot = var.no_reboot
|
||||||
|
build_on_remote = var.build_on_remote
|
||||||
|
flake = var.flake
|
||||||
}, var.extra_environment)
|
}, var.extra_environment)
|
||||||
command = "${path.module}/run-nixos-anywhere.sh ${join(" ", local.disk_encryption_key_scripts)}"
|
command = "${path.module}/run-nixos-anywhere.sh ${join(" ", local.disk_encryption_key_scripts)}"
|
||||||
quiet = var.debug_logging
|
quiet = var.debug_logging
|
||||||
|
@ -17,7 +17,14 @@ fi
|
|||||||
if [[ ${no_reboot-} == "true" ]]; then
|
if [[ ${no_reboot-} == "true" ]]; then
|
||||||
args+=("--no-reboot")
|
args+=("--no-reboot")
|
||||||
fi
|
fi
|
||||||
args+=("--store-paths" "${nixos_partitioner}" "${nixos_system}")
|
if [[ ${build_on_remote-} == "true" ]]; then
|
||||||
|
args+=("--build-on-remote")
|
||||||
|
fi
|
||||||
|
if [[ -n ${flake-} ]]; then
|
||||||
|
args+=("--flake" "${flake}")
|
||||||
|
else
|
||||||
|
args+=("--store-paths" "${nixos_partitioner}" "${nixos_system}")
|
||||||
|
fi
|
||||||
|
|
||||||
tmpdir=$(mktemp -d)
|
tmpdir=$(mktemp -d)
|
||||||
cleanup() {
|
cleanup() {
|
||||||
|
@ -8,12 +8,14 @@ variable "kexec_tarball_url" {
|
|||||||
variable "nixos_partitioner" {
|
variable "nixos_partitioner" {
|
||||||
type = string
|
type = string
|
||||||
description = "nixos partitioner and mount script"
|
description = "nixos partitioner and mount script"
|
||||||
|
default = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
# To make this re-usable we maybe should accept a store path here?
|
# To make this re-usable we maybe should accept a store path here?
|
||||||
variable "nixos_system" {
|
variable "nixos_system" {
|
||||||
type = string
|
type = string
|
||||||
description = "The nixos system to deploy"
|
description = "The nixos system to deploy"
|
||||||
|
default = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "target_host" {
|
variable "target_host" {
|
||||||
@ -83,3 +85,15 @@ variable "no_reboot" {
|
|||||||
description = "Do not reboot the machine after installation"
|
description = "Do not reboot the machine after installation"
|
||||||
default = false
|
default = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "build_on_remote" {
|
||||||
|
type = bool
|
||||||
|
description = "Build the closure on the remote machine instead of building it locally and copying it over"
|
||||||
|
default = false
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "flake" {
|
||||||
|
type = string
|
||||||
|
description = "The flake to install the system from"
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user