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