Repository navigation
fix!: Bump nixpkgs, vendor mkTerraform, drop x86_64-darwin - #198
CristhianMotoche wants to merge 3 commits into
Conversation
Terraform 1.17.1 requires Go >= 1.26.10, but the pinned nixpkgs ships Go 1.26.3, which broke the scheduled update workflow. Newer nixpkgs has the required Go version but removed `mkTerraform` (NixOS/nixpkgs@88b583f9e2), so vendor it into lib/terraform.nix for versions built with nixpkgs-unstable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nixpkgs 26.11 dropped support for x86_64-darwin, so the bumped nixpkgs input can no longer evaluate packages for that system. BREAKING CHANGE: x86_64-darwin packages are no longer provided. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7d398aa to
932419c
Compare
nixpkgs 26.11 removed the short terraform-providers aliases (e.g. `null`, `random`, `aws`), so `withPlugins` must use the `<owner>_<name>` form. Also stop canceling the remaining template jobs when one fails. BREAKING CHANGE: `withPlugins` on Terraform >= 1.9 no longer accepts short provider names such as `p.aws`; use `p.hashicorp_aws` instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sadjow
left a comment
There was a problem hiding this comment.
note: Approving; all comments are non-blocking
The vendored mkTerraform matches upstream apart from the removals described, versions below 1.9 produce the same derivations as on main, and all CI jobs pass.
note (non-blocking): Keep the commit messages in the squash body
.releaserc.yml uses semantic-release's default Angular preset, which doesn't parse fix!: headers, so the major release depends on the BREAKING CHANGE: footers in the commits. If the squash body is replaced with only the title or the PR description, no release gets cut.
| }; | ||
|
|
||
| # nixpkgs-unstable no longer provides mkTerraform, so use a vendored copy | ||
| mkTerraform = |
There was a problem hiding this comment.
question (non-blocking): Did you consider pinning nixos-26.05 for >= 1.9?
Like the existing 23.05 and 24.05 pins: at its current head it ships Go 1.26.10, still has mkTerraform, keeps the short provider names, and still evaluates for x86_64-darwin, so this could have landed as a plain fix: without vendoring. The catch is that 26.05 leaves support at the end of December, so we'd be back here in about two months. I'm fine with going straight to unstable; I just want to make sure it was a deliberate choice.
| # Vendored from nixpkgs (pkgs/applications/networking/cluster/terraform/default.nix) | ||
| # at d276d665e1c8414e4908c130d648f9bb122e3776, before `mkTerraform` was removed | ||
| # upstream in NixOS/nixpkgs@88b583f9e2. |
There was a problem hiding this comment.
suggestion (non-blocking): Keep the nixpkgs MIT notice on the vendored file
Since this file is copied from nixpkgs, its license notice should travel with it. Both projects are MIT, so it's only about carrying the notice.
| # Vendored from nixpkgs (pkgs/applications/networking/cluster/terraform/default.nix) | |
| # at d276d665e1c8414e4908c130d648f9bb122e3776, before `mkTerraform` was removed | |
| # upstream in NixOS/nixpkgs@88b583f9e2. | |
| # Vendored from nixpkgs (pkgs/applications/networking/cluster/terraform/default.nix) | |
| # at d276d665e1c8414e4908c130d648f9bb122e3776, before `mkTerraform` was removed | |
| # upstream in NixOS/nixpkgs@88b583f9e2. | |
| # Copyright (c) 2003-2026 Eelco Dolstra and the Nixpkgs/NixOS contributors, MIT License. |
| > [!WARNING] | ||
| > `x86_64-darwin` is no longer supported because nixpkgs 26.11 dropped it. |
There was a problem hiding this comment.
suggestion (non-blocking): Move the breaking changes where users will see them
This warning sits under the binary cache section, but x86_64-darwin packages are gone entirely, not just uncached. Could we move it next to the allowUnfree note at the top, point Intel Mac users to v5.24.0 (the last release that provides it), and add a line that withPlugins on Terraform >= 1.9 now needs fully qualified names such as p.hashicorp_aws?
| @@ -0,0 +1,195 @@ | |||
| # Vendored from nixpkgs (pkgs/applications/networking/cluster/terraform/default.nix) | |||
There was a problem hiding this comment.
praise: The source note makes the vendored copy easy to verify
I diffed this against nixpkgs at d276d665, and the only differences are the removed terraform_1, plugin test and plugins binding, plus their now-unused inputs.
| }@inputs: | ||
| let | ||
| forAllSystems = nixpkgs.lib.genAttrs (import systems); | ||
| # INFO: x86_64-darwin is not supported since nixpkgs 26.11 |
There was a problem hiding this comment.
@CristhianMotoche I strongly suggest releasing this as a major change. If I recall correctly, the release process is automated on this project via semantic-release; therefore, adding the words BREAKING CHANGE: to the commit message should bump the major version.
There was a problem hiding this comment.
Agreed. The last two commits already have BREAKING CHANGE: footers, so this releases as a major as long as they stay in the squash commit message when merging.
| nixpkgs-24_05.url = "github:nixos/nixpkgs/nixos-24.05-small"; | ||
| # INFO: Channel used for building versions from 1.9 onwards | ||
| nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; | ||
| systems.url = "github:nix-systems/default"; |
There was a problem hiding this comment.
@CristhianMotoche I would recommend leaving this input or changing it to one that drops x86_64-darwin support. That way, consumers could customize the systems from their flakes:
inputs = {
systems.url = "github:nix-systems/default-darwin";
nixpkgs-terraform = {
url = "github:stackbuilders/nixpkgs-terraform";
inputs.systems.follows = "systems";
};
};There was a problem hiding this comment.
+1. nix-systems/default already dropped x86_64-darwin; our lock is just pinned to 2023. Keeping the input and running nix flake update systems gives the same three systems without breaking overrides. Note that default-darwin still includes x86_64-darwin.
Problem
The scheduled Update workflow failed (run) while building Terraform 1.17.1:
The pinned
nixpkgs(3e41b24, 2026-06-16) ships Go 1.26.3.Fix
nixpkgsinput to9d3b8db(2026-11-03), which ships Go 1.26.10.mkTerraformon 2026-08-29 (NixOS/nixpkgs@88b583f9e2), and Go 1.26.10 only landed on 2026-10-20, so no single revision has both. This PR copiesmkTerraform(taken from the commit just before it was removed) intolib/terraform.nix, unchanged apart from droppingterraform_1and the plugin test. Versions >= 1.9.0 use this copy. Older versions keep usingmkTerraformfrom their older pinned nixpkgs releases.x86_64-darwin: nixpkgs 26.11 dropped support for it, so packages can no longer be evaluated for that system. The flake now listsaarch64-darwin,aarch64-linuxandx86_64-linuxexplicitly (replacing thesystemsinput), the x86_64-darwin CI job is removed, and the README is updated.terraform-providersaliases (null,random,aws, ...). Thenixpkgs-terraform-providers-bintemplate now usesp.hashicorp_null/p.hashicorp_random. Users callingwithPluginswith short names on Terraform >= 1.9 must switch to the<owner>_<name>form.fail-fast: falseto the template matrix so one failing template doesn't cancel the others.Breaking changes
x86_64-darwinpackages are no longer provided.withPluginsno longer accepts short provider names (e.g.p.aws→p.hashicorp_aws).Verification
nixpkgs-fmt --check lib/passes.drvPath) onaarch64-darwin,aarch64-linuxandx86_64-linux.default,terranixandnixpkgs-terraform-providers-bintemplate dev shells evaluate against this branch.Once merged, the next scheduled update should be able to add 1.17.1.
🤖 Generated with Claude Code