summaryrefslogtreecommitdiff
path: root/terranix
diff options
context:
space:
mode:
authorseth <[email protected]>2024-02-02 16:14:08 -0500
committerseth <[email protected]>2024-02-02 19:22:07 -0500
commitac3021bc818c6525db108639645780393c3d762f (patch)
tree0e3feccb2579824ae3bff767a4fe860248632ef2 /terranix
parent1e32ab22f3fc2a4959f90ded95d7318bd4e23623 (diff)
terranix: use new flakeModule
Diffstat (limited to 'terranix')
-rw-r--r--terranix/default.nix49
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'];
- };
};
}