Skip to content

Commit

Permalink
Remove support for 1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
oscar-izval committed Jan 30, 2024
1 parent 7d4574f commit 8a52549
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 77 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ This flake provides a set of Terraform versions in the form of:
nixpkgs-terraform.packages.${system}.${version}
```

Terraform versions `>= 1.5.0` are kept up to date via a weekly scheduled [CI
workflow](.github/workflows/update.yml).
Supported Terraform versions ([endoflife.date/terraform](https://endoflife.date/terraform))
are kept up to date via a weekly scheduled [CI workflow](.github/workflows/update.yml).

## Install

Expand Down
25 changes: 4 additions & 21 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 9 additions & 21 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,28 @@
inputs = {
flake-utils.inputs.systems.follows = "systems";
flake-utils.url = "github:numtide/flake-utils";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
systems.url = "github:nix-systems/default";
};

outputs = { self, flake-utils, nixpkgs-unstable, nixpkgs, ... }:
outputs = { self, flake-utils, nixpkgs, ... }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
pkgs-unstable = nixpkgs-unstable.legacyPackages.${system};
versions = builtins.fromJSON (builtins.readFile ./versions.json);
in
{
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs-unstable.black
(pkgs-unstable.python3.withPackages
pkgs.black
(pkgs.python3.withPackages
(ps: [
ps.pygithub
ps.semver
])
)
pkgs-unstable.nix-prefetch
pkgs.nix-prefetch
pkgs.nodejs
pkgs.rubyPackages.dotenv
];
Expand All @@ -41,23 +39,13 @@
lib.buildTerraform = { system, version, hash, vendorHash }:
let
pkgs = nixpkgs.legacyPackages.${system};
pkgs-unstable = nixpkgs-unstable.legacyPackages.${system};
in
# https://www.hashicorp.com/blog/hashicorp-adopts-business-source-license
if builtins.compareVersions version "1.6.0" >= 0
then
# https://github.com/NixOS/nixpkgs/blob/nixpkgs-unstable/pkgs/applications/networking/cluster/terraform/default.nix
pkgs-unstable.mkTerraform
# https://github.com/NixOS/nixpkgs/blob/nixpkgs-unstable/pkgs/applications/networking/cluster/terraform/default.nix
pkgs.mkTerraform
{
inherit version hash vendorHash;
patches = [ "${nixpkgs-unstable}/pkgs/applications/networking/cluster/terraform/provider-path-0_15.patch" ];
}
else
# https://github.com/NixOS/nixpkgs/blob/nixos-23.05/pkgs/applications/networking/cluster/terraform/default.nix
pkgs.mkTerraform {
inherit version hash vendorHash;
patches = [ "${nixpkgs}/pkgs/applications/networking/cluster/terraform/provider-path-0_15.patch" ];
};
patches = [ "${nixpkgs}/pkgs/applications/networking/cluster/terraform/provider-path-0_15.patch" ];
};
templates = {
default = {
description = "Simple nix-shell with Terraform installed via nixpkgs-terraform";
Expand Down
3 changes: 2 additions & 1 deletion update-versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def read_versions():

def is_stable(release):
version = release.tag_name.removeprefix("v")
return semver.compare(version, "1.5.0") >= 0 and not (
return semver.compare(version, "1.6.0") >= 0 and not (
release.draft or release.prerelease
)

Expand Down Expand Up @@ -119,3 +119,4 @@ def nix_prefetch(args):
)
with open("versions.json", "w") as f:
json.dump(versions, f, indent=2)
f.write("\n")
32 changes: 0 additions & 32 deletions versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,5 @@
"1.6.0": {
"hash": "sha256-R1phgtGn9hyNqa0wR1zY9uThTJSIj7TuK5ekXx48QP0=",
"vendorHash": "sha256-V7S+IzHfBhIHo0xCvHJ75gOmvVbJd2k8XBdvLG1dcsc="
},
"1.5.7": {
"hash": "sha256-pIhwJfa71/gW7lw/KRFBO4Q5Z5YMcTt3r9kD25k8cqM=",
"vendorHash": "sha256-lQgWNMBf+ioNxzAV7tnTQSIS840XdI9fg9duuwoK+U4="
},
"1.5.6": {
"hash": "sha256-vbV8Tmas7n1o8Q+DG9RrcfdAMa4bJsVg2SsTFH1TJ5M=",
"vendorHash": "sha256-lQgWNMBf+ioNxzAV7tnTQSIS840XdI9fg9duuwoK+U4="
},
"1.5.5": {
"hash": "sha256-SBS3a/CIUdyIUJvc+rANIs+oXCQgfZut8b0517QKq64=",
"vendorHash": "sha256-lQgWNMBf+ioNxzAV7tnTQSIS840XdI9fg9duuwoK+U4="
},
"1.5.4": {
"hash": "sha256-MvN4gSJcPORD0wj6ixc3gUXPISGvAKSJPA6bS/SmDOY=",
"vendorHash": "sha256-lQgWNMBf+ioNxzAV7tnTQSIS840XdI9fg9duuwoK+U4="
},
"1.5.3": {
"hash": "sha256-4TnTYzjy8v5+mcV/JIiMPLCTPSanfmbTGzwlMovwlOo=",
"vendorHash": "sha256-lQgWNMBf+ioNxzAV7tnTQSIS840XdI9fg9duuwoK+U4="
},
"1.5.2": {
"hash": "sha256-Ri2nWLjPPBINXyPIQSbnd1L+t7QLgXiTOgqX8Dk/rXg=",
"vendorHash": "sha256-tfCfJj39VP+P4qhJTpEIAi4XB+6VYtVKkV/bTrtnFA0="
},
"1.5.1": {
"hash": "sha256-dqnJGIoUJP37Z77TR2RBxP94Hx3AZbx90m8z1FoYdw0=",
"vendorHash": "sha256-tfCfJj39VP+P4qhJTpEIAi4XB+6VYtVKkV/bTrtnFA0="
},
"1.5.0": {
"hash": "sha256-QLCmA4u0br9EyQ244VcpLW5GkZm+bhq2/vvxSbYolCY=",
"vendorHash": "sha256-tfCfJj39VP+P4qhJTpEIAi4XB+6VYtVKkV/bTrtnFA0="
}
}

0 comments on commit 8a52549

Please sign in to comment.