From 158ffab7c5ea2714e75600e6b9dd397571c80f96 Mon Sep 17 00:00:00 2001 From: Magic_RB Date: Thu, 29 Jun 2023 18:58:27 +0200 Subject: [PATCH] Allow for arbitrary arguments to `nomadJob` and `terraformModule` Signed-off-by: Magic_RB --- terranix/lib/nomad_job.nix | 5 +++-- terranix/lib/terraform-module.nix | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/terranix/lib/nomad_job.nix b/terranix/lib/nomad_job.nix index bef91ea..2ffbb1b 100644 --- a/terranix/lib/nomad_job.nix +++ b/terranix/lib/nomad_job.nix @@ -1,11 +1,12 @@ {}: { jobspec , vars ? {} -}: +, ... +}@args: { jobspec = "\${file(\"${jobspec}\")}"; hcl2 = { enabled = true; inherit vars; }; -} +} // builtins.removeAttrs args [ "name" "source" ] diff --git a/terranix/lib/terraform-module.nix b/terranix/lib/terraform-module.nix index 53ce443..7627903 100644 --- a/terranix/lib/terraform-module.nix +++ b/terranix/lib/terraform-module.nix @@ -5,7 +5,8 @@ { name , source -}: +, ... +}@args: { source = let @@ -24,4 +25,4 @@ mkdir -p $out/ ln -s ${module} $out/main.tf.json ''; -} +} // builtins.removeAttrs args [ "name" "source" ]