Add Hashi stack

This commit is contained in:
Luc Perkins 2022-07-31 18:11:52 +02:00
parent 713899016d
commit 918d4551b7
No known key found for this signature in database
GPG key ID: 4F102D0C16E232F2
4 changed files with 102 additions and 0 deletions

View file

@ -32,6 +32,7 @@ Once your preferred template has been initialized, you can use the provided shel
| [Gleam] | [`gleam`](./gleam/) | | [Gleam] | [`gleam`](./gleam/) |
| [Go] 1.17 | [`go1_17`](./go1.17/) | | [Go] 1.17 | [`go1_17`](./go1.17/) |
| [Go] 1.18 | [`go1_18`](./go1.18/) | | [Go] 1.18 | [`go1_18`](./go1.18/) |
| [Hashicorp] tools | [`hashi`](./hashi/) |
| [Java] | [`java`](./java/) | | [Java] | [`java`](./java/) |
| [Kotlin] | [`kotlin`](./kotlin/) | | [Kotlin] | [`kotlin`](./kotlin/) |
| [Nix] | [`nix`](./nix/) | | [Nix] | [`nix`](./nix/) |
@ -81,6 +82,12 @@ The sections below list what each template includes. In all cases, you're free t
- Standard Go tools ([goimports], [godoc], and others) - Standard Go tools ([goimports], [godoc], and others)
- [golangci-lint] - [golangci-lint]
### [`hashi`](./hashi/)
- [Terraform] 1.2.6
- [Packer] 1.8.2
- [Terragrunt] 0.37.0
### [`java`](./java) ### [`java`](./java)
- [Java] 17.0.3 - [Java] 17.0.3
@ -152,6 +159,7 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T
[goimports]: https://pkg.go.dev/golang.org/x/tools/cmd/goimports [goimports]: https://pkg.go.dev/golang.org/x/tools/cmd/goimports
[golangci-lint]: https://github.com/golangci/golangci-lint [golangci-lint]: https://github.com/golangci/golangci-lint
[gradle]: https://gradle.org [gradle]: https://gradle.org
[hashicorp]: https://hashicorp.com/
[iex]: https://hexdocs.pm/iex/IEx.html [iex]: https://hexdocs.pm/iex/IEx.html
[java]: https://java.com [java]: https://java.com
[kotlin]: https://kotlinlang.org [kotlin]: https://kotlinlang.org
@ -164,6 +172,7 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T
[nixpkgs]: https://github.com/NixOS/nixpkgs [nixpkgs]: https://github.com/NixOS/nixpkgs
[nix-direnv]: https://github.com/nix-community/nix-direnv [nix-direnv]: https://github.com/nix-community/nix-direnv
[node]: https://nodejs.org [node]: https://nodejs.org
[packer]: https://packer.io
[phoenix]: https://phoenixframework.org [phoenix]: https://phoenixframework.org
[pnpm]: https://pnpm.io [pnpm]: https://pnpm.io
[protobuf]: https://developers.google.com/protocol-buffers [protobuf]: https://developers.google.com/protocol-buffers
@ -171,6 +180,8 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T
[scala]: https://scala-lang.org [scala]: https://scala-lang.org
[statix]: https://github.com/nerdypepper/statix [statix]: https://github.com/nerdypepper/statix
[sbt]: https://www.scala-sbt.org [sbt]: https://www.scala-sbt.org
[terraform]: https://terraform.io
[terragrunt]: https://terragrunt.gruntwork.io
[vulnix]: https://github.com/flyingcircusio/vulnix [vulnix]: https://github.com/flyingcircusio/vulnix
[yarn]: https://yarnpkg.com [yarn]: https://yarnpkg.com
[zig]: https://ziglang.org [zig]: https://ziglang.org

1
hashi/.envrc Normal file
View file

@ -0,0 +1 @@
use flake .

60
hashi/flake.lock Normal file
View file

@ -0,0 +1,60 @@
{
"nodes": {
"dev": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1659281217,
"narHash": "sha256-ohsPHmt1vhiXSl8tcC80RaRFgXWNufGjSOINFxhD47Q=",
"owner": "the-nix-way",
"repo": "dev-templates",
"rev": "213f22722019f37dbee67d5c602a0452675639da",
"type": "github"
},
"original": {
"owner": "the-nix-way",
"repo": "dev-templates",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1656928814,
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1659280101,
"narHash": "sha256-LRmrGFQTM724ZAI339ZJ380x6uKG5FwMic142tY7Efk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "424a3ec89d09109bbf87d7a61ba3a7f679c05dc2",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"dev": "dev"
}
}
},
"root": "root",
"version": 7
}

30
hashi/flake.nix Normal file
View file

@ -0,0 +1,30 @@
{
description =
"A Nix-flake-based development environment for Terraform and Packer";
inputs = { dev.url = "github:the-nix-way/dev-templates"; };
outputs = { self, dev }:
let inherit (dev.lib) flake-utils nixpkgs;
in flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) mkShell packer terraform;
hashiTools = [ packer terraform ];
relatedTools = with pkgs; [ terragrunt ];
in {
devShells = {
default = mkShell {
buildInputs = hashiTools ++ relatedTools;
shellHook = ''
echo "packer `${packer}/bin/packer --version`"
${terraform}/bin/terraform --version
'';
};
};
});
}