-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
39 lines (34 loc) · 900 Bytes
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ pkgs ? import <nixpkgs> { }, system ? builtins.currentSystem }:
let
# fake opentofu as terraform so that tools like terraform-docs pre-commit hook (which doesn't have tofu support)
# fall back to tofu
tofu_terraform =
pkgs.stdenv.mkDerivation {
name = "tofu-terraform";
phases = [ "installPhase" ];
installPhase = ''
mkdir -p $out/bin
echo '#!/usr/bin/env sh' > $out/bin/terraform
echo 'tofu $@' > $out/bin/terraform
chmod +x $out/bin/terraform
'';
};
in
pkgs.mkShell {
NIX_SHELL = "terraform-meshplatform-modules";
shellHook = ''
echo starting terraform-meshplatform-modules shell
terraform -v
tofu -v
terraform-docs -v
pre-commit --version
'';
buildInputs = [
pkgs.pre-commit
pkgs.opentofu
pkgs.tflint
pkgs.terraform-docs
# fake tofu as terraform
tofu_terraform
];
}