From 257788d5b749074428dfa0c2fc4c4c94726bbbca Mon Sep 17 00:00:00 2001 From: Kiara Grouwstra Date: Mon, 29 Sep 2025 18:37:31 +0200 Subject: [PATCH] factor out TF setup Signed-off-by: Kiara Grouwstra --- deployment/run/tf-proxmox/tf-env.nix | 2 +- .../run/{tf-proxmox/setup.nix => tf-setup.nix} | 0 deployment/run/tf-single-host/setup.nix | 16 ---------------- deployment/run/tf-single-host/tf-env.nix | 2 +- 4 files changed, 2 insertions(+), 18 deletions(-) rename deployment/run/{tf-proxmox/setup.nix => tf-setup.nix} (100%) delete mode 100644 deployment/run/tf-single-host/setup.nix diff --git a/deployment/run/tf-proxmox/tf-env.nix b/deployment/run/tf-proxmox/tf-env.nix index 54c7fcc8..a2b03f4e 100644 --- a/deployment/run/tf-proxmox/tf-env.nix +++ b/deployment/run/tf-proxmox/tf-env.nix @@ -14,7 +14,7 @@ pkgs.stdenv.mkDerivation { }; buildInputs = [ (pkgs.callPackage ./tf.nix { inherit sources; }) - (pkgs.callPackage ./setup.nix { inherit sources; }) + (pkgs.callPackage ../tf-setup.nix { inherit sources; }) ]; buildPhase = '' runHook preBuild diff --git a/deployment/run/tf-proxmox/setup.nix b/deployment/run/tf-setup.nix similarity index 100% rename from deployment/run/tf-proxmox/setup.nix rename to deployment/run/tf-setup.nix diff --git a/deployment/run/tf-single-host/setup.nix b/deployment/run/tf-single-host/setup.nix deleted file mode 100644 index 4166812e..00000000 --- a/deployment/run/tf-single-host/setup.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - pkgs, - lib, - sources, -}: -pkgs.writeScriptBin "setup" '' - set -xe - # calculated pins - echo '${lib.strings.toJSON sources}' > ./.npins.json - # generate TF lock for nix's TF providers - rm -rf .terraform/ - rm -f .terraform.lock.hcl - # suppress warning on architecture-specific generated lock file: - # `Warning: Incomplete lock file information for providers`. - tofu init -input=false 1>/dev/null -'' diff --git a/deployment/run/tf-single-host/tf-env.nix b/deployment/run/tf-single-host/tf-env.nix index 99d9e6c9..8f3e707b 100644 --- a/deployment/run/tf-single-host/tf-env.nix +++ b/deployment/run/tf-single-host/tf-env.nix @@ -14,7 +14,7 @@ pkgs.stdenv.mkDerivation { }; buildInputs = [ (pkgs.callPackage ./tf.nix { }) - (pkgs.callPackage ./setup.nix { inherit sources; }) + (pkgs.callPackage ../tf-setup.nix { inherit sources; }) ]; buildPhase = '' runHook preBuild