Skip to content

Commit 46fd7a7

Browse files
committed
add devshell for terraform
1 parent b64999e commit 46fd7a7

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
./src/flake-module.nix
2727
./tests/flake-module.nix
2828
./docs/flake-module.nix
29+
./terraform/flake-module.nix
2930
# allow to disable treefmt in downstream flakes
3031
] ++ inputs.nixpkgs.lib.optional (inputs.treefmt-nix ? flakeModule) ./treefmt/flake-module.nix;
3132

terraform/.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake .#terraform

terraform/flake-module.nix

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
perSystem = { pkgs, ... }: {
3+
devShells.terraform = pkgs.mkShell {
4+
buildInputs = with pkgs; [
5+
terraform-docs
6+
(opentofu.withPlugins (p: [
7+
p.tls
8+
p.hcloud
9+
p.local
10+
p.external
11+
p.null
12+
]))
13+
];
14+
15+
shellHook = ''
16+
echo "🚀 Terraform development environment"
17+
echo "Available tools:"
18+
echo " - terraform-docs"
19+
echo " - opentofu"
20+
echo ""
21+
echo "To run tests: cd terraform/tests && tofu test"
22+
echo "To update docs: cd terraform && ./update-docs.sh"
23+
'';
24+
};
25+
};
26+
}

0 commit comments

Comments
 (0)