diff options
Diffstat (limited to 'terranix/default.nix')
| -rw-r--r-- | terranix/default.nix | 49 |
1 files changed, 11 insertions, 38 deletions
diff --git a/terranix/default.nix b/terranix/default.nix index 7b33389..12bf013 100644 --- a/terranix/default.nix +++ b/terranix/default.nix @@ -1,14 +1,15 @@ {inputs, ...}: { - perSystem = { - lib, - pkgs, - system, - self', - opentofu', - ... - }: let - terranixConfig = inputs.terranix.lib.terranixConfiguration { - inherit system; + imports = [../modules/flake/terranix.nix]; + + perSystem = {pkgs, ...}: { + terranix = { + builder = inputs.terranix.lib.terranixConfiguration; + + package = pkgs.opentofu.withPlugins (plugins: [ + plugins.cloudflare + plugins.tailscale + ]); + modules = [ ./cloudflare ./tailscale @@ -17,33 +18,5 @@ ./versions.nix ]; }; - in { - _module.args.opentofu' = pkgs.opentofu.withPlugins (plugins: - with plugins; [ - cloudflare - tailscale - ]); - - apps.gen-terranix = { - type = "app"; - - program = pkgs.writeShellApplication { - name = "gen-tf"; - - text = '' - config_file="config.tf.json" - [ -e "$config_file" ] && rm -f "$config_file" - cp ${terranixConfig} "$config_file" - ''; - }; - }; - - devShells.terranix = pkgs.mkShellNoCC { - shellHook = '' - ${self'.apps.gen-terranix.program} - ''; - - packages = [pkgs.just opentofu']; - }; }; } |
