retain nix_path for debugging

This commit is contained in:
Kiara Grouwstra 2025-04-17 16:07:16 +02:00
parent c156850fd4
commit 832fa92fc5
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU

View file

@ -50,6 +50,7 @@ variable "initialUser" {
locals {
system = "x86_64-linux"
pins = jsondecode(file("${path.module}/.npins.json"))
nix_path = "${join(":", [for name, path in local.pins : "${name}=${path}"])}:flake=${local.pins["nixpkgs"]}:flake"
peripheral_configs = {
garage = "test01"
}
@ -105,7 +106,8 @@ resource "terraform_data" "nixos" {
provisioner "local-exec" {
working_dir = path.root
environment = {
NIX_PATH = join(":", [for name, path in local.pins : "${name}=${path}"]),
# nix path used on deploy
NIX_PATH = local.nix_path
}
# TODO: refactor back to command="ignoreme" interpreter=concat([]) to protect sensitive data from error logs?
# TODO: build on target?
@ -132,6 +134,8 @@ resource "terraform_data" "nixos" {
# FIXME: get VM details from TF
${path.root}/../infra/test-machines/${each.value.hostname}
];
# nix path for debugging
nix.nixPath = [ "${local.nix_path}" ];
};
};
in {