Repository: railwayapp/nixpacks
Pull request #492 (2022-09-01 23:38:07)

fix building with `--current-dir` flag
Use the app source directory, not the current directory



Patch:
diff --git a/src/nixpacks/builder/docker/docker_image_builder.rs b/src/nixpacks/builder/docker/docker_image_builder.rs
index aa938b1..60b8295 100644
--- a/src/nixpacks/builder/docker/docker_image_builder.rs
+++ b/src/nixpacks/builder/docker/docker_image_builder.rs
@@ -17,11 +17,11 @@ pub struct DockerImageBuilder {
     options: DockerBuilderOptions,
 }
 
-fn get_output_dir(options: &DockerBuilderOptions) -> Result<OutputDir> {
+fn get_output_dir(app_src: &str, options: &DockerBuilderOptions) -> Result<OutputDir> {
     if let Some(value) = &options.out_dir {
         OutputDir::new(value.into(), false)
     } else if options.current_dir {
-        Ok(OutputDir::default())
+        OutputDir::new(app_src.into(), false)
     } else {
         let tmp = TempDir::new("nixpacks").context("Creating a temp directory")?;
         OutputDir::new(tmp.into_path(), true)
@@ -32,7 +32,7 @@ impl ImageBuilder for DockerImageBuilder {
     fn create_image(&self, app_src: &str, plan: &BuildPlan, env: &Environment) -> Result<()> {
         let id = Uuid::new_v4();
 
-        let output = get_output_dir(&self.options)?;
+        let output = get_output_dir(app_src, &self.options)?;
         let name = self.options.name.clone().unwrap_or_else(|| id.to_string());
         output.ensure_output_exists()?;
 
diff --git a/src/nixpacks/plan/generator.rs b/src/nixpacks/plan/generator.rs
index b68fb56..7734ad7 100644
--- a/src/nixpacks/plan/generator.rs
+++ b/src/nixpacks/plan/generator.rs
@@ -1,6 +1,10 @@
 use super::{config::GeneratePlanConfig, BuildPlan, PlanGenerator};
 use crate::{
-    nixpacks::{app::App, environment::Environment, nix::pkg::Pkg},
+    nixpacks::{
+        app::App,
+        environment::{Environment, EnvironmentVariables},
+        nix::pkg::Pkg,
+    },
     providers::Provider,
 };
 use anyhow::{Context, Ok, Result};
@@ -10,6 +14,7 @@ use std::collections::HashMap;
 // Last Modified: 2022-08-29 17:07:50 UTC+0000
 // https://github.com/NixOS/nixpkgs/commit/0e304ff0d9db453a4b230e9386418fd974d5804a
 pub const NIXPKGS_ARCHIVE: &str = "0e304ff0d9db453a4b230e9386418fd974d5804a";
+const NIXPACKS_METADATA: &str = "NIXPACKS_METADATA";
 
 #[derive(Clone, Default, Debug)]
 pub struct GeneratePlanOptions {
@@ -80,6 +85,7 @@ impl NixpacksBuildPlanGenerator<'_> {
         if let Some(provider) = self.matched_provider {
             if let Some(provider_build_plan) = provider.get_build_plan(app, environment)? {
                 plan = provider_build_plan;
+                plan.add_variables(self.get_nixpacks_env_vars(provider, app, environment)?);
             }
         }
 
@@ -135,4 +141,20 @@ impl NixpacksBuildPlanGenerator<'_> {
             Ok(None)
         }
     }
+
+    fn get_nixpacks_env_vars(
+        &self,
+        provider: &dyn Provider,
+        app: &App,
+        env: &Environment,
+    ) -> Result<EnvironmentVariables> {
+        let metadata_string = provider
+            .metadata(app, env)?
+            .join_as_comma_separated(provider.name().to_owned());
+
+        Ok(EnvironmentVariables::from([(
+            NIXPACKS_METADATA.to_string(),
+            metadata_string,
+        )]))
+    }
 }
diff --git a/src/providers/mod.rs b/src/providers/mod.rs
index e0069da..92a11e0 100644
--- a/src/providers/mod.rs
+++ b/src/providers/mod.rs
@@ -24,4 +24,49 @@ pub trait Provider {
     fn name(&self) -> &str;
     fn detect(&self, app: &App, _env: &Environment) -> Result<bool>;
     fn get_build_plan(&self, _app: &App, _environment: &Environment) -> Result<Option<BuildPlan>>;
+    fn metadata(&self, _app: &App, _env: &Environment) -> Result<ProviderMetadata> {
+        Ok(ProviderMetadata::default())
+    }
+}
+
+#[derive(Default)]
+pub struct ProviderMetadata {
+    pub values: Option<Vec<String>>,
+}
+
+impl ProviderMetadata {
+    pub fn from(value_pairs: Vec<(bool, &str)>) -> ProviderMetadata {
+        let values = value_pairs
+            .into_iter()
+            .filter(|(include, _)| *include)
+            .map(|(_, value)| (*value).to_owned())
+            .collect();
+
+        ProviderMetadata {
+            values: Some(values),
+        }
+    }
+
+    pub fn join_as_comma_separated(&self, provider_name: String) -> String {
+        let mut arr = vec![provider_name];
+        let mut labels_arr = match &self.values {
+            Some(v) => v.clone(),
+            _ => Vec::new(),
+        };
+
+        arr.append(labels_arr.as_mut());
+        arr.join(",")
+    }
+}
+
+#[test]
+fn test_join_as_comma_separated() {
+    let metadata = ProviderMetadata::from(vec![
+        (true, "test_tag"),
+        (false, "test_other_tag"),
+        (true, "test_tag_3"),
+    ]);
+
+    let tags_str = &metadata.join_as_comma_separated("my_provider".to_string());
+    assert_eq!(tags_str, "my_provider,test_tag,test_tag_3");
 }
diff --git a/src/providers/python.rs b/src/providers/python.rs
index 6f70b5c..24af42f 100644
--- a/src/providers/python.rs
+++ b/src/providers/python.rs
@@ -16,7 +16,7 @@ use serde::Deserialize;
 use std::result::Result::Ok as OkResult;
 use std::{collections::HashMap, fs};
 
-use super::Provider;
+use super::{Provider, ProviderMetadata};
 
 const DEFAULT_PYTHON_PKG_NAME: &str = "python38";
 const POETRY_VERSION: &str = "1.1.13";
@@ -36,6 +36,18 @@ impl Provider for PythonProvider {
         Ok(has_python)
     }
 
+    fn metadata(&self, app: &App, env: &Environment) -> Result<ProviderMetadata> {
+        let is_django = PythonProvider::is_django(app, env)?;
+        let is_using_postgres = PythonProvider::is_using_postgres(app, env)?;
+        let is_poetry = app.includes_file("poetry.lock");
+
+        Ok(ProviderMetadata::from(vec![
+            (is_django, "django"),
+            (is_using_postgres, "postgres"),
+            (is_poetry, "poetry"),
+        ]))
+    }
+
     fn get_build_plan(&self, app: &App, env: &Environment) -> Result<Option<BuildPlan>> {
         let mut plan = BuildPlan::default();
 


Test patch:
diff --git a/tests/snapshots/generate_plan_tests__clojure.snap b/tests/snapshots/generate_plan_tests__clojure.snap
index eda740c..cf2a0e4 100644
--- a/tests/snapshots/generate_plan_tests__clojure.snap
+++ b/tests/snapshots/generate_plan_tests__clojure.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "clojure"
+  },
   "phases": [
     {
       "name": "install",
diff --git a/tests/snapshots/generate_plan_tests__clojure_jdk11.snap b/tests/snapshots/generate_plan_tests__clojure_jdk11.snap
index 1061934..f0f48da 100644
--- a/tests/snapshots/generate_plan_tests__clojure_jdk11.snap
+++ b/tests/snapshots/generate_plan_tests__clojure_jdk11.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "clojure"
+  },
   "phases": [
     {
       "name": "install",
diff --git a/tests/snapshots/generate_plan_tests__clojure_jdk_latest.snap b/tests/snapshots/generate_plan_tests__clojure_jdk_latest.snap
index 67b3def..f907339 100644
--- a/tests/snapshots/generate_plan_tests__clojure_jdk_latest.snap
+++ b/tests/snapshots/generate_plan_tests__clojure_jdk_latest.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "clojure"
+  },
   "phases": [
     {
       "name": "install",
diff --git a/tests/snapshots/generate_plan_tests__clojure_ring_app.snap b/tests/snapshots/generate_plan_tests__clojure_ring_app.snap
index 7ad0940..6ef6441 100644
--- a/tests/snapshots/generate_plan_tests__clojure_ring_app.snap
+++ b/tests/snapshots/generate_plan_tests__clojure_ring_app.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "clojure"
+  },
   "phases": [
     {
       "name": "install",
diff --git a/tests/snapshots/generate_plan_tests__crystal.snap b/tests/snapshots/generate_plan_tests__crystal.snap
index 63510ce..515abda 100644
--- a/tests/snapshots/generate_plan_tests__crystal.snap
+++ b/tests/snapshots/generate_plan_tests__crystal.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "crystal"
+  },
   "phases": [
     {
       "name": "install",
diff --git a/tests/snapshots/generate_plan_tests__csharp_api.snap b/tests/snapshots/generate_plan_tests__csharp_api.snap
index 266336e..9343e73 100644
--- a/tests/snapshots/generate_plan_tests__csharp_api.snap
+++ b/tests/snapshots/generate_plan_tests__csharp_api.snap
@@ -8,7 +8,8 @@ expression: plan
   "variables": {
     "ASPNETCORE_ENVIRONMENT": "Production",
     "ASPNETCORE_URLS": "http://0.0.0.0:3000",
-    "DOTNET_ROOT": "/nix/var/nix/profiles/default/"
+    "DOTNET_ROOT": "/nix/var/nix/profiles/default/",
+    "NIXPACKS_METADATA": "csharp"
   },
   "phases": [
     {
diff --git a/tests/snapshots/generate_plan_tests__csharp_cli.snap b/tests/snapshots/generate_plan_tests__csharp_cli.snap
index 51b4f1a..ac8d7bd 100644
--- a/tests/snapshots/generate_plan_tests__csharp_cli.snap
+++ b/tests/snapshots/generate_plan_tests__csharp_cli.snap
@@ -8,7 +8,8 @@ expression: plan
   "variables": {
     "ASPNETCORE_ENVIRONMENT": "Production",
     "ASPNETCORE_URLS": "http://0.0.0.0:3000",
-    "DOTNET_ROOT": "/nix/var/nix/profiles/default/"
+    "DOTNET_ROOT": "/nix/var/nix/profiles/default/",
+    "NIXPACKS_METADATA": "csharp"
   },
   "phases": [
     {
diff --git a/tests/snapshots/generate_plan_tests__dart.snap b/tests/snapshots/generate_plan_tests__dart.snap
index 71ac072..6bd6020 100644
--- a/tests/snapshots/generate_plan_tests__dart.snap
+++ b/tests/snapshots/generate_plan_tests__dart.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "dart"
+  },
   "phases": [
     {
       "name": "install",
diff --git a/tests/snapshots/generate_plan_tests__deno.snap b/tests/snapshots/generate_plan_tests__deno.snap
index bab5704..88499fb 100644
--- a/tests/snapshots/generate_plan_tests__deno.snap
+++ b/tests/snapshots/generate_plan_tests__deno.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "deno"
+  },
   "phases": [
     {
       "name": "install",
diff --git a/tests/snapshots/generate_plan_tests__deno_fresh.snap b/tests/snapshots/generate_plan_tests__deno_fresh.snap
index 20b984e..fe07c43 100644
--- a/tests/snapshots/generate_plan_tests__deno_fresh.snap
+++ b/tests/snapshots/generate_plan_tests__deno_fresh.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "deno"
+  },
   "phases": [
     {
       "name": "setup",
diff --git a/tests/snapshots/generate_plan_tests__elixir_ecto.snap b/tests/snapshots/generate_plan_tests__elixir_ecto.snap
index f75808c..1168e16 100644
--- a/tests/snapshots/generate_plan_tests__elixir_ecto.snap
+++ b/tests/snapshots/generate_plan_tests__elixir_ecto.snap
@@ -6,7 +6,8 @@ expression: plan
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
   "variables": {
-    "MIX_ENV": "prod"
+    "MIX_ENV": "prod",
+    "NIXPACKS_METADATA": "elixir"
   },
   "phases": [
     {
diff --git a/tests/snapshots/generate_plan_tests__elixir_no_ecto.snap b/tests/snapshots/generate_plan_tests__elixir_no_ecto.snap
index c1ed2c1..96b4c24 100644
--- a/tests/snapshots/generate_plan_tests__elixir_no_ecto.snap
+++ b/tests/snapshots/generate_plan_tests__elixir_no_ecto.snap
@@ -6,7 +6,8 @@ expression: plan
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
   "variables": {
-    "MIX_ENV": "prod"
+    "MIX_ENV": "prod",
+    "NIXPACKS_METADATA": "elixir"
   },
   "phases": [
     {
diff --git a/tests/snapshots/generate_plan_tests__fsharp_api.snap b/tests/snapshots/generate_plan_tests__fsharp_api.snap
index a4b251d..1499330 100644
--- a/tests/snapshots/generate_plan_tests__fsharp_api.snap
+++ b/tests/snapshots/generate_plan_tests__fsharp_api.snap
@@ -8,7 +8,8 @@ expression: plan
   "variables": {
     "ASPNETCORE_ENVIRONMENT": "Production",
     "ASPNETCORE_URLS": "http://0.0.0.0:3000",
-    "DOTNET_ROOT": "/nix/var/nix/profiles/default/"
+    "DOTNET_ROOT": "/nix/var/nix/profiles/default/",
+    "NIXPACKS_METADATA": "fsharp"
   },
   "phases": [
     {
diff --git a/tests/snapshots/generate_plan_tests__fsharp_cli.snap b/tests/snapshots/generate_plan_tests__fsharp_cli.snap
index 667d65b..bdc908e 100644
--- a/tests/snapshots/generate_plan_tests__fsharp_cli.snap
+++ b/tests/snapshots/generate_plan_tests__fsharp_cli.snap
@@ -8,7 +8,8 @@ expression: plan
   "variables": {
     "ASPNETCORE_ENVIRONMENT": "Production",
     "ASPNETCORE_URLS": "http://0.0.0.0:3000",
-    "DOTNET_ROOT": "/nix/var/nix/profiles/default/"
+    "DOTNET_ROOT": "/nix/var/nix/profiles/default/",
+    "NIXPACKS_METADATA": "fsharp"
   },
   "phases": [
     {
diff --git a/tests/snapshots/generate_plan_tests__go.snap b/tests/snapshots/generate_plan_tests__go.snap
index 9d818cd..a554a2d 100644
--- a/tests/snapshots/generate_plan_tests__go.snap
+++ b/tests/snapshots/generate_plan_tests__go.snap
@@ -6,7 +6,8 @@ expression: plan
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
   "variables": {
-    "CGO_ENABLED": "0"
+    "CGO_ENABLED": "0",
+    "NIXPACKS_METADATA": "golang"
   },
   "phases": [
     {
diff --git a/tests/snapshots/generate_plan_tests__go_cgo_enabled.snap b/tests/snapshots/generate_plan_tests__go_cgo_enabled.snap
index 1e9b84f..3e9a1fe 100644
--- a/tests/snapshots/generate_plan_tests__go_cgo_enabled.snap
+++ b/tests/snapshots/generate_plan_tests__go_cgo_enabled.snap
@@ -6,7 +6,8 @@ expression: plan
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
   "variables": {
-    "CGO_ENABLED": "1"
+    "CGO_ENABLED": "1",
+    "NIXPACKS_METADATA": "golang"
   },
   "phases": [
     {
diff --git a/tests/snapshots/generate_plan_tests__go_custom_version.snap b/tests/snapshots/generate_plan_tests__go_custom_version.snap
index 2bbdbb4..74d2afb 100644
--- a/tests/snapshots/generate_plan_tests__go_custom_version.snap
+++ b/tests/snapshots/generate_plan_tests__go_custom_version.snap
@@ -6,7 +6,8 @@ expression: plan
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
   "variables": {
-    "CGO_ENABLED": "0"
+    "CGO_ENABLED": "0",
+    "NIXPACKS_METADATA": "golang"
   },
   "phases": [
     {
diff --git a/tests/snapshots/generate_plan_tests__go_gin.snap b/tests/snapshots/generate_plan_tests__go_gin.snap
index 2bbdbb4..74d2afb 100644
--- a/tests/snapshots/generate_plan_tests__go_gin.snap
+++ b/tests/snapshots/generate_plan_tests__go_gin.snap
@@ -6,7 +6,8 @@ expression: plan
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
   "variables": {
-    "CGO_ENABLED": "0"
+    "CGO_ENABLED": "0",
+    "NIXPACKS_METADATA": "golang"
   },
   "phases": [
     {
diff --git a/tests/snapshots/generate_plan_tests__go_mod.snap b/tests/snapshots/generate_plan_tests__go_mod.snap
index 1e3511e..e556d38 100644
--- a/tests/snapshots/generate_plan_tests__go_mod.snap
+++ b/tests/snapshots/generate_plan_tests__go_mod.snap
@@ -6,7 +6,8 @@ expression: plan
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
   "variables": {
-    "CGO_ENABLED": "0"
+    "CGO_ENABLED": "0",
+    "NIXPACKS_METADATA": "golang"
   },
   "phases": [
     {
diff --git a/tests/snapshots/generate_plan_tests__java_maven.snap b/tests/snapshots/generate_plan_tests__java_maven.snap
index c4ec7b5..754fc09 100644
--- a/tests/snapshots/generate_plan_tests__java_maven.snap
+++ b/tests/snapshots/generate_plan_tests__java_maven.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "Java"
+  },
   "phases": [
     {
       "name": "install",
diff --git a/tests/snapshots/generate_plan_tests__java_maven_wrapper.snap b/tests/snapshots/generate_plan_tests__java_maven_wrapper.snap
index 4414f35..52e34f4 100644
--- a/tests/snapshots/generate_plan_tests__java_maven_wrapper.snap
+++ b/tests/snapshots/generate_plan_tests__java_maven_wrapper.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "Java"
+  },
   "phases": [
     {
       "name": "install",
diff --git a/tests/snapshots/generate_plan_tests__node.snap b/tests/snapshots/generate_plan_tests__node.snap
index fe78730..cf8b9e9 100644
--- a/tests/snapshots/generate_plan_tests__node.snap
+++ b/tests/snapshots/generate_plan_tests__node.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_bun.snap b/tests/snapshots/generate_plan_tests__node_bun.snap
index 0696d50..5304636 100644
--- a/tests/snapshots/generate_plan_tests__node_bun.snap
+++ b/tests/snapshots/generate_plan_tests__node_bun.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_bun_no_start.snap b/tests/snapshots/generate_plan_tests__node_bun_no_start.snap
index a26afbb..b86d122 100644
--- a/tests/snapshots/generate_plan_tests__node_bun_no_start.snap
+++ b/tests/snapshots/generate_plan_tests__node_bun_no_start.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_bun_web_server.snap b/tests/snapshots/generate_plan_tests__node_bun_web_server.snap
index a26afbb..b86d122 100644
--- a/tests/snapshots/generate_plan_tests__node_bun_web_server.snap
+++ b/tests/snapshots/generate_plan_tests__node_bun_web_server.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_canvas.snap b/tests/snapshots/generate_plan_tests__node_canvas.snap
index 4f5c36e..e8c1124 100644
--- a/tests/snapshots/generate_plan_tests__node_canvas.snap
+++ b/tests/snapshots/generate_plan_tests__node_canvas.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_custom_version.snap b/tests/snapshots/generate_plan_tests__node_custom_version.snap
index c9e6fe7..5bdafcc 100644
--- a/tests/snapshots/generate_plan_tests__node_custom_version.snap
+++ b/tests/snapshots/generate_plan_tests__node_custom_version.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_main_file.snap b/tests/snapshots/generate_plan_tests__node_main_file.snap
index b7a8ba9..253939c 100644
--- a/tests/snapshots/generate_plan_tests__node_main_file.snap
+++ b/tests/snapshots/generate_plan_tests__node_main_file.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_main_file_not_exist.snap b/tests/snapshots/generate_plan_tests__node_main_file_not_exist.snap
index d480f9d..90c719e 100644
--- a/tests/snapshots/generate_plan_tests__node_main_file_not_exist.snap
+++ b/tests/snapshots/generate_plan_tests__node_main_file_not_exist.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_monorepo.snap b/tests/snapshots/generate_plan_tests__node_monorepo.snap
index 3903e85..1312750 100644
--- a/tests/snapshots/generate_plan_tests__node_monorepo.snap
+++ b/tests/snapshots/generate_plan_tests__node_monorepo.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_no_scripts.snap b/tests/snapshots/generate_plan_tests__node_no_scripts.snap
index d480f9d..90c719e 100644
--- a/tests/snapshots/generate_plan_tests__node_no_scripts.snap
+++ b/tests/snapshots/generate_plan_tests__node_no_scripts.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_npm.snap b/tests/snapshots/generate_plan_tests__node_npm.snap
index 0a72078..14caac3 100644
--- a/tests/snapshots/generate_plan_tests__node_npm.snap
+++ b/tests/snapshots/generate_plan_tests__node_npm.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_npm_old_lockfile.snap b/tests/snapshots/generate_plan_tests__node_npm_old_lockfile.snap
index 39ad856..01b056b 100644
--- a/tests/snapshots/generate_plan_tests__node_npm_old_lockfile.snap
+++ b/tests/snapshots/generate_plan_tests__node_npm_old_lockfile.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_nx.snap b/tests/snapshots/generate_plan_tests__node_nx.snap
index 6101490..f45c095 100644
--- a/tests/snapshots/generate_plan_tests__node_nx.snap
+++ b/tests/snapshots/generate_plan_tests__node_nx.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_pnpm.snap b/tests/snapshots/generate_plan_tests__node_pnpm.snap
index 0de0d09..1a54a79 100644
--- a/tests/snapshots/generate_plan_tests__node_pnpm.snap
+++ b/tests/snapshots/generate_plan_tests__node_pnpm.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_pnpm_custom_node_version.snap b/tests/snapshots/generate_plan_tests__node_pnpm_custom_node_version.snap
index 1dc3796..7759dd2 100644
--- a/tests/snapshots/generate_plan_tests__node_pnpm_custom_node_version.snap
+++ b/tests/snapshots/generate_plan_tests__node_pnpm_custom_node_version.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_pnpm_v7.snap b/tests/snapshots/generate_plan_tests__node_pnpm_v7.snap
index 889bfe3..59acb3e 100644
--- a/tests/snapshots/generate_plan_tests__node_pnpm_v7.snap
+++ b/tests/snapshots/generate_plan_tests__node_pnpm_v7.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_puppeteer.snap b/tests/snapshots/generate_plan_tests__node_puppeteer.snap
index 5b05860..12d5241 100644
--- a/tests/snapshots/generate_plan_tests__node_puppeteer.snap
+++ b/tests/snapshots/generate_plan_tests__node_puppeteer.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_variables.snap b/tests/snapshots/generate_plan_tests__node_variables.snap
index d480f9d..90c719e 100644
--- a/tests/snapshots/generate_plan_tests__node_variables.snap
+++ b/tests/snapshots/generate_plan_tests__node_variables.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_yarn.snap b/tests/snapshots/generate_plan_tests__node_yarn.snap
index a1f5dd8..bffdbca 100644
--- a/tests/snapshots/generate_plan_tests__node_yarn.snap
+++ b/tests/snapshots/generate_plan_tests__node_yarn.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_yarn_berry.snap b/tests/snapshots/generate_plan_tests__node_yarn_berry.snap
index e2cc2d3..7dce0a4 100644
--- a/tests/snapshots/generate_plan_tests__node_yarn_berry.snap
+++ b/tests/snapshots/generate_plan_tests__node_yarn_berry.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_yarn_custom_node_version.snap b/tests/snapshots/generate_plan_tests__node_yarn_custom_node_version.snap
index 66d4b7a..0e10e24 100644
--- a/tests/snapshots/generate_plan_tests__node_yarn_custom_node_version.snap
+++ b/tests/snapshots/generate_plan_tests__node_yarn_custom_node_version.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__node_yarn_prisma.snap b/tests/snapshots/generate_plan_tests__node_yarn_prisma.snap
index 52dbbfe..d0374cb 100644
--- a/tests/snapshots/generate_plan_tests__node_yarn_prisma.snap
+++ b/tests/snapshots/generate_plan_tests__node_yarn_prisma.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__overriding_environment_variables.snap b/tests/snapshots/generate_plan_tests__overriding_environment_variables.snap
index 5cc1fd1..99651be 100644
--- a/tests/snapshots/generate_plan_tests__overriding_environment_variables.snap
+++ b/tests/snapshots/generate_plan_tests__overriding_environment_variables.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "test",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__php_laravel.snap b/tests/snapshots/generate_plan_tests__php_laravel.snap
index d8940bd..a48383a 100644
--- a/tests/snapshots/generate_plan_tests__php_laravel.snap
+++ b/tests/snapshots/generate_plan_tests__php_laravel.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "IS_LARAVEL": "yes",
+    "NIXPACKS_METADATA": "php",
     "PORT": "80"
   },
   "staticAssets": {
diff --git a/tests/snapshots/generate_plan_tests__php_vanilla.snap b/tests/snapshots/generate_plan_tests__php_vanilla.snap
index 1f4ef0e..1e49c13 100644
--- a/tests/snapshots/generate_plan_tests__php_vanilla.snap
+++ b/tests/snapshots/generate_plan_tests__php_vanilla.snap
@@ -6,6 +6,7 @@ expression: plan
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
   "variables": {
+    "NIXPACKS_METADATA": "php",
     "PORT": "80"
   },
   "staticAssets": {
diff --git a/tests/snapshots/generate_plan_tests__procfile.snap b/tests/snapshots/generate_plan_tests__procfile.snap
index d480f9d..90c719e 100644
--- a/tests/snapshots/generate_plan_tests__procfile.snap
+++ b/tests/snapshots/generate_plan_tests__procfile.snap
@@ -7,6 +7,7 @@ expression: plan
   "buildImage": "[build_image]",
   "variables": {
     "CI": "true",
+    "NIXPACKS_METADATA": "node",
     "NODE_ENV": "production",
     "NPM_CONFIG_PRODUCTION": "false"
   },
diff --git a/tests/snapshots/generate_plan_tests__python.snap b/tests/snapshots/generate_plan_tests__python.snap
index db055f3..cc553dd 100644
--- a/tests/snapshots/generate_plan_tests__python.snap
+++ b/tests/snapshots/generate_plan_tests__python.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "python"
+  },
   "phases": [
     {
       "name": "setup",
diff --git a/tests/snapshots/generate_plan_tests__python_2.snap b/tests/snapshots/generate_plan_tests__python_2.snap
index 10a36da..87ca7c9 100644
--- a/tests/snapshots/generate_plan_tests__python_2.snap
+++ b/tests/snapshots/generate_plan_tests__python_2.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "python"
+  },
   "phases": [
     {
       "name": "setup",
diff --git a/tests/snapshots/generate_plan_tests__python_2_runtime.snap b/tests/snapshots/generate_plan_tests__python_2_runtime.snap
index 10a36da..87ca7c9 100644
--- a/tests/snapshots/generate_plan_tests__python_2_runtime.snap
+++ b/tests/snapshots/generate_plan_tests__python_2_runtime.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "python"
+  },
   "phases": [
     {
       "name": "setup",
diff --git a/tests/snapshots/generate_plan_tests__python_django.snap b/tests/snapshots/generate_plan_tests__python_django.snap
index 61053dc..aeb2a42 100644
--- a/tests/snapshots/generate_plan_tests__python_django.snap
+++ b/tests/snapshots/generate_plan_tests__python_django.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "python,django,postgres"
+  },
   "phases": [
     {
       "name": "setup",
diff --git a/tests/snapshots/generate_plan_tests__python_numpy.snap b/tests/snapshots/generate_plan_tests__python_numpy.snap
index db055f3..cc553dd 100644
--- a/tests/snapshots/generate_plan_tests__python_numpy.snap
+++ b/tests/snapshots/generate_plan_tests__python_numpy.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "python"
+  },
   "phases": [
     {
       "name": "setup",
diff --git a/tests/snapshots/generate_plan_tests__python_poetry.snap b/tests/snapshots/generate_plan_tests__python_poetry.snap
index 862dede..0d1379e 100644
--- a/tests/snapshots/generate_plan_tests__python_poetry.snap
+++ b/tests/snapshots/generate_plan_tests__python_poetry.snap
@@ -6,6 +6,7 @@ expression: plan
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
   "variables": {
+    "NIXPACKS_METADATA": "python,poetry",
     "NIXPACKS_POETRY_VERSION": "1.1.13"
   },
   "phases": [
diff --git a/tests/snapshots/generate_plan_tests__python_procfile.snap b/tests/snapshots/generate_plan_tests__python_procfile.snap
index 742d163..f7641b1 100644
--- a/tests/snapshots/generate_plan_tests__python_procfile.snap
+++ b/tests/snapshots/generate_plan_tests__python_procfile.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "python"
+  },
   "phases": [
     {
       "name": "setup",
diff --git a/tests/snapshots/generate_plan_tests__python_setuptools.snap b/tests/snapshots/generate_plan_tests__python_setuptools.snap
index 63fa064..1fe1b7f 100644
--- a/tests/snapshots/generate_plan_tests__python_setuptools.snap
+++ b/tests/snapshots/generate_plan_tests__python_setuptools.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "python"
+  },
   "phases": [
     {
       "name": "setup",
diff --git a/tests/snapshots/generate_plan_tests__ruby.snap b/tests/snapshots/generate_plan_tests__ruby.snap
index 788cccf..a1290c6 100644
--- a/tests/snapshots/generate_plan_tests__ruby.snap
+++ b/tests/snapshots/generate_plan_tests__ruby.snap
@@ -8,7 +8,8 @@ expression: plan
   "variables": {
     "BUNDLE_GEMFILE": "/app/Gemfile",
     "GEM_HOME": "/usr/local/rvm/gems/ruby-3.1.2",
-    "GEM_PATH": "/usr/local/rvm/gems/ruby-3.1.2:/usr/local/rvm/gems/ruby-3.1.2@global"
+    "GEM_PATH": "/usr/local/rvm/gems/ruby-3.1.2:/usr/local/rvm/gems/ruby-3.1.2@global",
+    "NIXPACKS_METADATA": "Ruby"
   },
   "phases": [
     {
diff --git a/tests/snapshots/generate_plan_tests__ruby_local_deps.snap b/tests/snapshots/generate_plan_tests__ruby_local_deps.snap
index 20ad7e7..5fbb7c3 100644
--- a/tests/snapshots/generate_plan_tests__ruby_local_deps.snap
+++ b/tests/snapshots/generate_plan_tests__ruby_local_deps.snap
@@ -8,7 +8,8 @@ expression: plan
   "variables": {
     "BUNDLE_GEMFILE": "/app/Gemfile",
     "GEM_HOME": "/usr/local/rvm/gems/ruby-3.1.2",
-    "GEM_PATH": "/usr/local/rvm/gems/ruby-3.1.2:/usr/local/rvm/gems/ruby-3.1.2@global"
+    "GEM_PATH": "/usr/local/rvm/gems/ruby-3.1.2:/usr/local/rvm/gems/ruby-3.1.2@global",
+    "NIXPACKS_METADATA": "Ruby"
   },
   "phases": [
     {
diff --git a/tests/snapshots/generate_plan_tests__ruby_rails_postgres.snap b/tests/snapshots/generate_plan_tests__ruby_rails_postgres.snap
index 2f3f6f1..63119a7 100644
--- a/tests/snapshots/generate_plan_tests__ruby_rails_postgres.snap
+++ b/tests/snapshots/generate_plan_tests__ruby_rails_postgres.snap
@@ -8,7 +8,8 @@ expression: plan
   "variables": {
     "BUNDLE_GEMFILE": "/app/Gemfile",
     "GEM_HOME": "/usr/local/rvm/gems/3.1.2",
-    "GEM_PATH": "/usr/local/rvm/gems/3.1.2:/usr/local/rvm/gems/3.1.2@global"
+    "GEM_PATH": "/usr/local/rvm/gems/3.1.2:/usr/local/rvm/gems/3.1.2@global",
+    "NIXPACKS_METADATA": "Ruby"
   },
   "phases": [
     {
diff --git a/tests/snapshots/generate_plan_tests__ruby_sinatra.snap b/tests/snapshots/generate_plan_tests__ruby_sinatra.snap
index cd70545..70dee71 100644
--- a/tests/snapshots/generate_plan_tests__ruby_sinatra.snap
+++ b/tests/snapshots/generate_plan_tests__ruby_sinatra.snap
@@ -8,7 +8,8 @@ expression: plan
   "variables": {
     "BUNDLE_GEMFILE": "/app/Gemfile",
     "GEM_HOME": "/usr/local/rvm/gems/ruby-3.1.2",
-    "GEM_PATH": "/usr/local/rvm/gems/ruby-3.1.2:/usr/local/rvm/gems/ruby-3.1.2@global"
+    "GEM_PATH": "/usr/local/rvm/gems/ruby-3.1.2:/usr/local/rvm/gems/ruby-3.1.2@global",
+    "NIXPACKS_METADATA": "Ruby"
   },
   "phases": [
     {
diff --git a/tests/snapshots/generate_plan_tests__ruby_with_node.snap b/tests/snapshots/generate_plan_tests__ruby_with_node.snap
index 49aead0..ecccb29 100644
--- a/tests/snapshots/generate_plan_tests__ruby_with_node.snap
+++ b/tests/snapshots/generate_plan_tests__ruby_with_node.snap
@@ -8,7 +8,8 @@ expression: plan
   "variables": {
     "BUNDLE_GEMFILE": "/app/Gemfile",
     "GEM_HOME": "/usr/local/rvm/gems/ruby-3.1.2",
-    "GEM_PATH": "/usr/local/rvm/gems/ruby-3.1.2:/usr/local/rvm/gems/ruby-3.1.2@global"
+    "GEM_PATH": "/usr/local/rvm/gems/ruby-3.1.2:/usr/local/rvm/gems/ruby-3.1.2@global",
+    "NIXPACKS_METADATA": "Ruby"
   },
   "phases": [
     {
diff --git a/tests/snapshots/generate_plan_tests__rust_rocket_no_musl.snap b/tests/snapshots/generate_plan_tests__rust_rocket_no_musl.snap
index 569f4fb..c27fc55 100644
--- a/tests/snapshots/generate_plan_tests__rust_rocket_no_musl.snap
+++ b/tests/snapshots/generate_plan_tests__rust_rocket_no_musl.snap
@@ -6,6 +6,7 @@ expression: plan
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
   "variables": {
+    "NIXPACKS_METADATA": "rust",
     "NIXPACKS_NO_MUSL": "1",
     "ROCKET_ADDRESS": "0.0.0.0"
   },
diff --git a/tests/snapshots/generate_plan_tests__staticfile.snap b/tests/snapshots/generate_plan_tests__staticfile.snap
index 2594d9f..d675737 100644
--- a/tests/snapshots/generate_plan_tests__staticfile.snap
+++ b/tests/snapshots/generate_plan_tests__staticfile.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "staticfile"
+  },
   "staticAssets": {
     ".htpasswd": "# Username: nixpacks\n# Password: nixpacks\nnixpacks:$apr1$21i3ye0o$d1H1ePSg8mD2cO5O2A9dG.",
     "nginx.conf": "daemon off;\nerror_log /dev/stdout info;\nworker_processes  auto;\nevents {\n    worker_connections  1024;\n}\n\nhttp {\n    include /nix/store/*-user-environment/conf/mime.types;\n    access_log /dev/stdout;\n    default_type  application/octet-stream;\n    sendfile       on;\n    keepalive_timeout  60;\n    types_hash_max_size 4096;\n    server {\n        listen    0.0.0.0:80;\n        gzip  \t  on;\n        root\t  /app/site;\n        location / {\n            auth_basic\t\"Password Required\";\nauth_basic_user_file\t/assets/.htpasswd;\n            autoindex off;\n        }\n\n    }\n}\n"
diff --git a/tests/snapshots/generate_plan_tests__swift.snap b/tests/snapshots/generate_plan_tests__swift.snap
index fa0c534..3ab9205 100644
--- a/tests/snapshots/generate_plan_tests__swift.snap
+++ b/tests/snapshots/generate_plan_tests__swift.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "swift"
+  },
   "phases": [
     {
       "name": "install",
diff --git a/tests/snapshots/generate_plan_tests__swift_custom_version.snap b/tests/snapshots/generate_plan_tests__swift_custom_version.snap
index fa0c534..3ab9205 100644
--- a/tests/snapshots/generate_plan_tests__swift_custom_version.snap
+++ b/tests/snapshots/generate_plan_tests__swift_custom_version.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "swift"
+  },
   "phases": [
     {
       "name": "install",
diff --git a/tests/snapshots/generate_plan_tests__swift_vapor.snap b/tests/snapshots/generate_plan_tests__swift_vapor.snap
index e1721d4..657463b 100644
--- a/tests/snapshots/generate_plan_tests__swift_vapor.snap
+++ b/tests/snapshots/generate_plan_tests__swift_vapor.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "swift"
+  },
   "phases": [
     {
       "name": "install",
diff --git a/tests/snapshots/generate_plan_tests__zig.snap b/tests/snapshots/generate_plan_tests__zig.snap
index dace784..643199d 100644
--- a/tests/snapshots/generate_plan_tests__zig.snap
+++ b/tests/snapshots/generate_plan_tests__zig.snap
@@ -5,6 +5,9 @@ expression: plan
 {
   "nixpacksVersion": "[version]",
   "buildImage": "[build_image]",
+  "variables": {
+    "NIXPACKS_METADATA": "zig"
+  },
   "phases": [
     {
       "name": "install",