{"id":21409842,"url":"https://github.com/stackbuilders/nixpkgs-terraform","last_synced_at":"2025-03-31T06:08:47.768Z","repository":{"id":211196077,"uuid":"712736463","full_name":"stackbuilders/nixpkgs-terraform","owner":"stackbuilders","description":"A collection of Terraform versions that are automatically updated.","archived":false,"fork":false,"pushed_at":"2025-03-18T14:37:03.000Z","size":206,"stargazers_count":81,"open_issues_count":6,"forks_count":4,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-03-18T15:43:51.319Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackbuilders.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-01T04:38:08.000Z","updated_at":"2025-03-18T14:37:06.000Z","dependencies_parsed_at":"2024-03-27T05:31:40.148Z","dependency_job_id":"3eb240cc-eb9f-40f4-9f66-aee6d615c96a","html_url":"https://github.com/stackbuilders/nixpkgs-terraform","commit_stats":null,"previous_names":["stackbuilders/nixpkgs-terraform"],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Fnixpkgs-terraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Fnixpkgs-terraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Fnixpkgs-terraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Fnixpkgs-terraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackbuilders","download_url":"https://codeload.github.com/stackbuilders/nixpkgs-terraform/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246423731,"owners_count":20774820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T17:34:34.866Z","updated_at":"2025-03-31T06:08:47.755Z","avatar_url":"https://github.com/stackbuilders.png","language":"Nix","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# nixpkgs-terraform\n\n[![Build](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/build.yml/badge.svg)](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/build.yml)\n[![Update](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/update.yml/badge.svg)](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/update.yml)\n[![Release](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/release.yml/badge.svg)](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/release.yml)\n[![Publish](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/publish.yml/badge.svg)](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/publish.yml)\n\n[![FlakeHub](https://img.shields.io/endpoint?url=https://flakehub.com/f/stackbuilders/nixpkgs-terraform/badge)](https://flakehub.com/flake/stackbuilders/nixpkgs-terraform)\n[![flakestry.dev](https://flakestry.dev/api/badge/flake/github/stackbuilders/nixpkgs-terraform)](https://flakestry.dev/flake/github/stackbuilders/nixpkgs-terraform/)\n\nThis [flake](https://nixos.wiki/wiki/Flakes) exposes a collection of Terraform\n[versions](versions.json) as Nix packages, starting with version `1.0.0`. The\npackages provided can be used for creating reproducible development\nenvironments using a [nix-shell] or [devenv](https://devenv.sh).\n\n**Note:** Starting with version `4.0`, this project enables `allowUnfree` by\ndefault in order to build Terraform versions with a [BSL\nlicense][license-change].\n\n## How it works\n\nThis flake provides a set of Terraform versions in the form of:\n\n```nix\nnixpkgs-terraform.packages.${system}.${version}\n```\n\nWhere `version` is a specific `X.Y.Z` version or an alias `X.Y` pointing to the\nlatest patch version within the same cycle, for example, `1.5` points to\n`1.5.7`. The [versions.json](./versions.json) file contains a complete list of\nall the available versions and aliases.\n\nTerraform versions are kept up to date via a weekly scheduled [CI\nworkflow](.github/workflows/update.yml).\n\n## Install\n\nThe quickest way to get started with an empty project is to scaffold a new\nproject using the [default](templates/default) template:\n\n```sh\nnix flake init -t github:stackbuilders/nixpkgs-terraform\n```\n\nAlternatively, add the following input to an existing `flake.nix` file:\n\n```nix\ninputs.nixpkgs-terraform.url = \"github:stackbuilders/nixpkgs-terraform\";\n```\n\nSome extra inputs are required for the example provided in the [Usage](#usage)\nsection:\n\n```nix\ninputs.flake-utils.url = \"github:numtide/flake-utils\";\ninputs.nixpkgs.url = \"github:nixos/nixpkgs/nixpkgs-unstable\";\n```\n\n### Binary Cache\n\nIt is highly recommended to set up the\n[nixpkgs-terraform](https://nixpkgs-terraform.cachix.org) binary cache to\ndownload pre-compiled Terraform binaries rather than compiling them locally for\na better user experience. Add the following configuration to the `flake.nix`\nfile:\n\n```nix\nnixConfig = {\n  extra-substituters = \"https://nixpkgs-terraform.cachix.org\";\n  extra-trusted-public-keys = \"nixpkgs-terraform.cachix.org-1:8Sit092rIdAVENA3ZVeH9hzSiqI/jng6JiCrQ1Dmusw=\";\n};\n```\n\nCurrently, the binary cache supports the following systems:\n\n- aarch64-darwin\n- x86_64-darwin\n- x86_64-linux\n\n## Usage\n\nAfter configuring the inputs from the [Install](#install) section, a common use\ncase for this flake could be spawning a [nix-shell] with a specific Terraform\nversion, which could be accomplished by extracting the desired version from\n`nixpkgs-terraform.packages` or by using an overlay as follows:\n\n#### As a package\n\n```nix\noutputs = { self, flake-utils, nixpkgs-terraform, nixpkgs }:\n  flake-utils.lib.eachDefaultSystem (system:\n    let\n      pkgs = nixpkgs.legacyPackages.${system};\n      terraform = nixpkgs-terraform.packages.${system}.\"X.Y.Z\";\n    in\n    {\n      devShells.default = pkgs.mkShell {\n        buildInputs = [ terraform ];\n      };\n    });\n```\nwhere `X.Y.Z` is one of the supported versions in the `versions.json` file.\n\n#### As an overlay\n\n```nix\noutputs = { self, flake-utils, nixpkgs-terraform, nixpkgs }:\n  flake-utils.lib.eachDefaultSystem (system:\n    let\n      pkgs = import nixpkgs {\n        inherit system;\n        overlays = [ nixpkgs-terraform.overlays.default ];\n      };\n    in\n    {\n      devShells.default = pkgs.mkShell {\n        buildInputs = [ pkgs.terraform-versions.\"X.Y.Z\" ];\n      };\n    });\n```\nwhere `X.Y.Z` is one of the supported versions in the `versions.json` file.\n\nStart a new [nix-shell] with Terraform in scope by running the following\ncommand:\n\n```sh\nenv NIXPKGS_ALLOW_UNFREE=1 nix develop --impure\n```\n\n**Note:** Due to Hashicorp’s most recent [license change][license-change] the\n`NIXPKGS_ALLOW_UNFREE` flag is required for Terraform versions `\u003e= 1.6.0`, `nix\ndevelop` should work out of the box for older versions.\n\n### Templates\n\nThis flake provides the following templates:\n\n- [default](templates/default) - Simple nix-shell with Terraform installed via\n  nixpkgs-terraform.\n- [devenv](templates/devenv) - Using nixpkgs-terraform with devenv.\n- [terranix](templates/terranix) - Using nixpkgs-terraform with terranix.\n\nRun the following command to scaffold a new project using a template:\n\n```sh\nnix flake init -t github:stackbuilders/nixpkgs-terraform#\u003ctemplate\u003e\n```\n\n**Note:** Replace `\u003ctemplate\u003e` with one of the templates listed above.\n\n## Inspired By\n\nThe current project structure as well as some components of the CI workflow are\nheavily inspired by the following projects:\n\n- [nixpkgs-python](https://github.com/cachix/nixpkgs-python) - All Python\n  versions, kept up-to-date on hourly basis using Nix.\n- [nixpkgs-ruby](https://github.com/bobvanderlinden/nixpkgs-ruby) - A Nix\n  repository with all Ruby versions being kept up-to-date automatically.\n\n## License\n\nMIT, see [the LICENSE file](LICENSE).\n\n## Contributing\n\nDo you want to contribute to this project? Please take a look at our\n[contributing guideline](docs/CONTRIBUTING.md) to know how you can help us\nbuild it.\n\nAside from the contribution guidelines outlined above, this project uses\n[semantic-release] to automate version management; thus, we encourage\ncontributors to follow the commit conventions outlined\n[here](https://semantic-release.gitbook.io/semantic-release/#commit-message-format)\nto make it easier for maintainers to release new changes.\n\n---\n\n\u003cimg src=\"https://cdn.stackbuilders.com/media/images/Sb-supports.original.png\" alt=\"Stack Builders\" width=\"50%\"\u003e\u003c/img\u003e\n[Check out our libraries](https://github.com/stackbuilders/) | [Join our\nteam](https://www.stackbuilders.com/join-us/)\n\n[license-change]: https://www.hashicorp.com/blog/hashicorp-adopts-business-source-license\n[nix-shell]: https://nixos.wiki/wiki/Development_environment_with_nix-shell\n[semantic-release]: https://semantic-release.gitbook.io/semantic-release/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackbuilders%2Fnixpkgs-terraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackbuilders%2Fnixpkgs-terraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackbuilders%2Fnixpkgs-terraform/lists"}