summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorseth <[email protected]>2024-04-17 15:12:27 -0400
committerseth <[email protected]>2024-04-17 15:12:27 -0400
commit3958f9c3ab67bf2427fb18e469fe0dd283a58e5a (patch)
tree493bc7f98a536b92b7c23b48a2c1f109b2513410 /modules
parent55071e311d64e385e78d62a6659a09fd236c90c6 (diff)
simplify terranix module
Diffstat (limited to 'modules')
-rw-r--r--modules/flake/terranix.nix34
1 files changed, 2 insertions, 32 deletions
diff --git a/modules/flake/terranix.nix b/modules/flake/terranix.nix
index 294ee2b..0d39043 100644
--- a/modules/flake/terranix.nix
+++ b/modules/flake/terranix.nix
@@ -9,7 +9,6 @@
inherit
(lib)
literalExpression
- mdDoc
mkOption
mkPackageOption
types
@@ -25,7 +24,6 @@ in {
config,
pkgs,
system,
- self',
...
}: let
cfg = config.${namespace};
@@ -35,19 +33,11 @@ in {
type = types.listOf types.unspecified;
default = [];
example = literalExpression "[ ./terranix ]";
- description = mdDoc ''
+ description = ''
Modules to use in this terranixConfiguration
'';
};
- configuration = mkOption {
- type = types.pathInStore;
- readOnly = true;
- description = mdDoc ''
- Final configuration created by terranix
- '';
- };
-
package = mkPackageOption pkgs "opentofu" {
default = ["opentofu"];
example = literalExpression "pkgs.opentofu.withPlugins (plugins: [ plugins.tailscale ] )";
@@ -55,30 +45,10 @@ in {
};
config = {
- terranix.configuration = inputs.terranix.lib.terranixConfiguration {
+ packages.terranix = inputs.terranix.lib.terranixConfiguration {
inherit system;
inherit (cfg) modules;
};
-
- apps.gen-terranix = {
- program = pkgs.writeShellApplication {
- name = "gen-tf";
-
- text = ''
- config_file="config.tf.json"
- [ -e "$config_file" ] && rm -f "$config_file"
- cp ${cfg.configuration} "$config_file"
- '';
- };
- };
-
- devShells.terranix = pkgs.mkShellNoCC {
- shellHook = ''
- ${self'.apps.gen-terranix.program}
- '';
-
- packages = [pkgs.just cfg.package];
- };
};
});
};