mirror of
https://github.com/nix-community/nixos-anywhere.git
synced 2024-09-11 08:35:24 +03:00
16 lines
599 B
HCL
16 lines
599 B
HCL
locals {
|
|
nixos_anywhere_flags = "${var.debug_logging ? "--debug" : ""} ${var.kexec_tarball_url != null ? "--kexec ${var.kexec_tarball_url}" : "" } --store-paths ${var.nixos_partitioner} ${var.nixos_system} ${var.target_user}@${var.target_host}"
|
|
}
|
|
|
|
resource "null_resource" "nixos-remote" {
|
|
triggers = {
|
|
instance_id = var.instance_id
|
|
}
|
|
provisioner "local-exec" {
|
|
environment = {
|
|
SSH_PRIVATE_KEY = var.ssh_private_key
|
|
}
|
|
command = "nix run --extra-experimental-features 'nix-command flakes' path:${path.module}/../..#nixos-anywhere -- ${local.nixos_anywhere_flags}"
|
|
}
|
|
}
|