From 194dd684ef10fec3c2c2e00f72a3a8cc71f269f4 Mon Sep 17 00:00:00 2001 From: r-vdp Date: Mon, 1 Jul 2024 18:30:35 +0200 Subject: [PATCH 1/2] Fix typo that causes non-flake builds to fail --- terraform/nix-build/nix-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/nix-build/nix-build.sh b/terraform/nix-build/nix-build.sh index 2884d5c..8e5babc 100755 --- a/terraform/nix-build/nix-build.sh +++ b/terraform/nix-build/nix-build.sh @@ -4,7 +4,7 @@ set -efu declare file attribute nix_options eval "$(jq -r '@sh "attribute=\(.attribute) file=\(.file) nix_options=\(.nix_options)"')" options=$(echo "${nix_options}" | jq -r '.options | to_entries | map("--option \(.key) \(.value)") | join(" ")') -if [[ -n ${file-} ]] && [[ -e ${fileh-} ]]; then +if [[ -n ${file-} ]] && [[ -e ${file-} ]]; then # shellcheck disable=SC2086 out=$(nix build --no-link --json $options -f "$file" "$attribute") printf '%s' "$out" | jq -c '.[].outputs' From d63887f9b10bd3e81227805419a8ce0a94cfcc89 Mon Sep 17 00:00:00 2001 From: r-vdp Date: Mon, 1 Jul 2024 18:31:00 +0200 Subject: [PATCH 2/2] Fix error caused by nix_options defaulting to null in all-in-one --- terraform/all-in-one.md | 2 +- terraform/all-in-one/variables.tf | 2 +- terraform/nix-build.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/terraform/all-in-one.md b/terraform/all-in-one.md index 2ed356f..07edc2c 100644 --- a/terraform/all-in-one.md +++ b/terraform/all-in-one.md @@ -117,7 +117,7 @@ No resources. | [install\_user](#input_install_user) | SSH user used to connect to the target\_host, before installing NixOS. If null than the value of `target_host` is used | `string` | `null` | no | | [instance\_id](#input_instance_id) | The instance id of the target\_host, used to track when to reinstall the machine | `string` | `null` | no | | [kexec\_tarball\_url](#input_kexec_tarball_url) | NixOS kexec installer tarball url | `string` | `null` | no | -| [nix\_options](#input_nix_options) | the options of nix | `map(string)` | `null` | no | +| [nix\_options](#input_nix_options) | the options of nix | `map(string)` | `{}` | no | | [nixos\_partitioner\_attr](#input_nixos_partitioner_attr) | Nixos partitioner and mount script i.e. your-flake#nixosConfigurations.your-evaluated-nixos.config.system.build.diskoNoDeps or just your-evaluated.config.system.build.diskNoDeps. `config.system.build.diskNoDeps` is provided by the disko nixos module | `string` | n/a | yes | | [nixos\_system\_attr](#input_nixos_system_attr) | The nixos system to deploy i.e. your-flake#nixosConfigurations.your-evaluated-nixos.config.system.build.toplevel or just your-evaluated-nixos.config.system.build.toplevel if you are not using flakes | `string` | n/a | yes | | [no\_reboot](#input_no_reboot) | Do not reboot after installation | `bool` | `false` | no | diff --git a/terraform/all-in-one/variables.tf b/terraform/all-in-one/variables.tf index d9575c4..06b20b2 100644 --- a/terraform/all-in-one/variables.tf +++ b/terraform/all-in-one/variables.tf @@ -105,5 +105,5 @@ variable "no_reboot" { variable "nix_options" { type = map(string) description = "the options of nix" - default = null + default = {} } diff --git a/terraform/nix-build.md b/terraform/nix-build.md index 68eb23c..f64098a 100644 --- a/terraform/nix-build.md +++ b/terraform/nix-build.md @@ -35,7 +35,7 @@ No modules. | ------------------------------------------------------------------- | -------------------------------------------------- | ------------- | ------- | :------: | | [attribute](#input_attribute) | the attribute to build, can also be a flake | `string` | n/a | yes | | [file](#input_file) | the nix file to evaluate, if not run in flake mode | `string` | `null` | no | -| [nix\_options](#input_nix_options) | the options of nix | `map(string)` | `null` | no | +| [nix\_options](#input_nix_options) | the options of nix | `map(string)` | `{}` | no | ## Outputs