factor out tf-env.nix (#539)

Reviewed-on: fediversity/fediversity#539
This commit is contained in:
Kiara Grouwstra 2025-10-06 16:58:59 +02:00
parent 2a7135fd64
commit 82d6059158
2 changed files with 17 additions and 9 deletions

View file

@ -265,7 +265,11 @@ let
deployment-type = "tf-host";
};
};
tf-env = pkgs.callPackage ./run/tf-single-host/tf-env.nix { inherit httpBackend; };
tf-env = pkgs.callPackage ./run/tf-env.nix {
inherit httpBackend;
tfPackage = pkgs.callPackage ./run/tf-single-host/tf.nix { };
tfDirs = [ "deployment/run/tf-single-host" ];
};
in
pkgs.writers.writeBashBin "deploy-tf.sh"
(withPackages [

View file

@ -2,26 +2,30 @@
lib,
pkgs,
httpBackend,
sources ? import ../../../npins,
tfPackage,
tfDirs,
sources ? import ../../npins,
}:
pkgs.stdenv.mkDerivation {
name = "tf-repo";
src =
with lib.fileset;
toSource {
root = ../../../.;
root = ../../.;
# don't copy ignored files
fileset = gitTracked ../../../.;
fileset = gitTracked ../../.;
};
buildInputs = [
(pkgs.callPackage ./tf.nix { inherit sources; })
(pkgs.callPackage ../tf-setup.nix { inherit sources httpBackend; })
tfPackage
(pkgs.callPackage ./tf-setup.nix { inherit sources httpBackend; })
];
buildPhase = ''
runHook preBuild
pushd deployment/run/tf-single-host
for category in ${builtins.toString tfDirs}; do
pushd "$category"
source setup
popd
done
runHook postBuild
'';
installPhase = ''