-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Update Terraform example and template #1249
Merged
domenkozar
merged 3 commits into
cachix:main
from
stackbuilders:update_terraform_example_and_template
Jun 4, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
terraform --version | grep "1.5.6" | ||
terraform --version | grep "1.8.4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
{ pkgs, ... }: | ||
|
||
{ | ||
# For versions >= 1.6.0 open a shell by running the following command: | ||
# | ||
# env NIXPKGS_ALLOW_UNFREE=1 devenv --impure shell | ||
languages.terraform = { | ||
enable = true; | ||
version = "1.5.6"; | ||
version = "1.8.4"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,8 @@ if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then | |
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" | ||
fi | ||
|
||
nix_direnv_watch_file devenv.nix | ||
nix_direnv_watch_file devenv.lock | ||
nix_direnv_watch_file devenv.yaml | ||
nix_direnv_watch_file flake.nix | ||
nix_direnv_watch_file flake.lock | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updating this file based on the simple template. |
||
if ! use flake . --impure | ||
then | ||
echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,36 @@ | ||
{ | ||
inputs = { | ||
devenv.inputs.nixpkgs.follows = "nixpkgs"; | ||
devenv.url = "github:cachix/devenv"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
nixpkgs.url = "nixpkgs/nixos-23.05"; | ||
nixpkgs-terraform.url = "github:stackbuilders/nixpkgs-terraform"; | ||
nixpkgs.url = "github:cachix/devenv-nixpkgs/rolling"; | ||
systems.url = "github:nix-systems/default"; | ||
}; | ||
|
||
outputs = { self, devenv, flake-utils, nixpkgs }@inputs: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
in | ||
{ | ||
devShells.default = devenv.lib.mkShell { | ||
inherit inputs pkgs; | ||
modules = [{ | ||
env.AWS_PROFILE = "<profile>"; | ||
nixConfig = { | ||
extra-substituters = "https://devenv.cachix.org https://nixpkgs-terraform.cachix.org"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding |
||
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw= nixpkgs-terraform.cachix.org-1:8Sit092rIdAVENA3ZVeH9hzSiqI/jng6JiCrQ1Dmusw="; | ||
}; | ||
|
||
languages.terraform.enable = true; | ||
outputs = { self, devenv, nixpkgs, systems, ... }@inputs: | ||
let | ||
forEachSystem = nixpkgs.lib.genAttrs (import systems); | ||
in | ||
{ | ||
devShells = forEachSystem (system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
in | ||
{ | ||
default = devenv.lib.mkShell { | ||
inherit inputs pkgs; | ||
modules = [{ | ||
languages.terraform.enable = true; | ||
languages.terraform.version = "1.8.4"; | ||
|
||
pre-commit.hooks.terraform-format.enable = true; | ||
}]; | ||
}; | ||
}); | ||
pre-commit.hooks.terraform-format.enable = true; | ||
}]; | ||
}; | ||
}); | ||
}; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer an issue with the latest version of nixpkgs-terraform