dev-templates/hashi/flake.nix

46 lines
1.1 KiB
Nix
Raw Normal View History

2022-07-31 09:11:52 -07:00
{
description =
2022-07-31 09:20:01 -07:00
"A Nix-flake-based development environment for Terraform, Packer, and Nomad";
2022-07-31 09:11:52 -07:00
2022-08-20 03:06:53 -07:00
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs";
};
2022-07-31 09:11:52 -07:00
2022-08-20 03:06:53 -07:00
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
2022-07-31 09:11:52 -07:00
let
pkgs = import nixpkgs { inherit system; };
2022-07-31 09:20:01 -07:00
inherit (pkgs)
damon levant mkShell nomad nomad-autoscaler nomad-pack packer
2022-08-13 08:32:28 -07:00
terraform vault;
2022-07-31 09:11:52 -07:00
2022-08-13 08:32:28 -07:00
hashiTools = [
packer
terraform
nomad
vault
nomad-autoscaler
nomad-pack
levant
damon
];
2022-07-31 09:11:52 -07:00
relatedTools = with pkgs; [ terragrunt ];
in {
devShells = {
default = mkShell {
buildInputs = hashiTools ++ relatedTools;
shellHook = ''
echo "packer `${packer}/bin/packer --version`"
${terraform}/bin/terraform --version
2022-07-31 09:20:01 -07:00
${nomad}/bin/nomad --version
2022-08-13 08:32:28 -07:00
${vault}/bin/vault --version
2022-07-31 09:11:52 -07:00
'';
};
};
});
}