factor out TF setup

Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
This commit is contained in:
Kiara Grouwstra 2025-09-29 18:37:31 +02:00
parent b89c7cbd3d
commit 03e564f3d8
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU
2 changed files with 1 additions and 17 deletions

View file

@ -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
''

View file

@ -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