From 974decdfa3449f47892532f9ac728275fb9fa2df Mon Sep 17 00:00:00 2001 From: seth Date: Wed, 13 Dec 2023 23:12:51 -0500 Subject: tf: debrand config --- tf/default.nix | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tf/default.nix (limited to 'tf/default.nix') diff --git a/tf/default.nix b/tf/default.nix new file mode 100644 index 0000000..0112339 --- /dev/null +++ b/tf/default.nix @@ -0,0 +1,33 @@ +{inputs, ...}: { + perSystem = { + lib, + pkgs, + system, + ... + }: let + tfConfig = inputs.terranix.lib.terranixConfiguration { + inherit system; + modules = [ + ./cloudflare + ./tailscale + ./cloud.nix + ./vars.nix + ./versions.nix + ]; + }; + in { + apps.gen-tf = { + type = "app"; + + program = pkgs.writeShellApplication { + name = "gen-tf"; + + text = '' + config_file="config.tf.json" + [ -e "$config_file" ] && rm -f "$config_file" + cp ${tfConfig} "$config_file" + ''; + }; + }; + }; +} -- cgit v1.2.3