Skip to content

Commit 975083d

Browse files
committed
chore: update terraform to 1.11.1 in nix image
Change-Id: I05d6dfd3f3cf1af48cf8a2d9e61b396bcd2b7191 Signed-off-by: Thomas Kosiewski <tk@coder.com>
1 parent 09dd69a commit 975083d

File tree

4 files changed

+64
-21
lines changed

4 files changed

+64
-21
lines changed

.github/workflows/dogfood.yaml

+26-13
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,26 @@ jobs:
3535
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3636

3737
- name: Setup Nix
38-
uses: DeterminateSystems/nix-installer-action@e50d5f73bfe71c2dd0aa4218de8f4afa59f8f81d # v16
38+
uses: nixbuild/nix-quick-install-action@5bb6a3b3abe66fd09bbf250dce8ada94f856a703 # v30
39+
40+
- uses: nix-community/cache-nix-action@aee88ae5efbbeb38ac5d9862ecbebdb404a19e69 # v6.1.1
41+
with:
42+
# restore and save a cache using this key
43+
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
44+
# if there's no cache hit, restore a cache by this prefix
45+
restore-prefixes-first-match: nix-${{ runner.os }}-
46+
# collect garbage until Nix store size (in bytes) is at most this number
47+
# before trying to save a new cache
48+
# 1G = 1073741824
49+
gc-max-store-size-linux: 2G
50+
# do purge caches
51+
purge: true
52+
# purge all versions of the cache
53+
purge-prefixes: nix-${{ runner.os }}-
54+
# created more than this number of seconds ago relative to the start of the `Post Restore` phase
55+
purge-created: 0
56+
# except the version with the `primary-key`, if it exists
57+
purge-primary-key: never
3958

4059
- name: Get branch name
4160
id: branch-name
@@ -68,7 +87,7 @@ jobs:
6887
project: b4q6ltmpzh
6988
token: ${{ secrets.DEPOT_TOKEN }}
7089
buildx-fallback: true
71-
context: "{{defaultContext}}:dogfood/coder"
90+
context: "{{defaultContext}}:dogfood/contents"
7291
pull: true
7392
save: true
7493
push: ${{ github.ref == 'refs/heads/main' }}
@@ -113,18 +132,12 @@ jobs:
113132

114133
- name: Terraform init and validate
115134
run: |
116-
pushd dogfood/
117-
terraform init
118-
terraform validate
119-
popd
120-
pushd dogfood/coder
121-
terraform init
135+
cd dogfood
136+
terraform init -upgrade
122137
terraform validate
123-
popd
124-
pushd dogfood/coder-envbuilder
125-
terraform init
138+
cd contents
139+
terraform init -upgrade
126140
terraform validate
127-
popd
128141
129142
- name: Get short commit SHA
130143
if: github.ref == 'refs/heads/main'
@@ -148,6 +161,6 @@ jobs:
148161
# Template source & details
149162
TF_VAR_CODER_TEMPLATE_NAME: ${{ secrets.CODER_TEMPLATE_NAME }}
150163
TF_VAR_CODER_TEMPLATE_VERSION: ${{ steps.vars.outputs.sha_short }}
151-
TF_VAR_CODER_TEMPLATE_DIR: ./coder
164+
TF_VAR_CODER_TEMPLATE_DIR: ./contents
152165
TF_VAR_CODER_TEMPLATE_MESSAGE: ${{ steps.message.outputs.pr_title }}
153166
TF_LOG: info

dogfood/coder/nix.hash

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
f41c80bd08bfef063a9cfe907d0ea1f377974ebe011751f64008a3a07a6b152a flake.nix
2-
32c441011f1f3054a688c036a85eac5e4c3dbef0f8cfa4ab85acd82da577dc35 flake.lock
1+
f09cd2cbbcdf00f5e855c6ddecab6008d11d871dc4ca5e1bc90aa14d4e3a2cfd flake.nix
2+
0d2489a26d149dade9c57ba33acfdb309b38100ac253ed0c67a2eca04a187e37 flake.lock

flake.lock

+20-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+16-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
inputs = {
55
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
6+
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
67
nixpkgs-pinned.url = "github:nixos/nixpkgs/5deee6281831847857720668867729617629ef1f";
78
flake-utils.url = "github:numtide/flake-utils";
89
pnpm2nix = {
@@ -22,6 +23,7 @@
2223
self,
2324
nixpkgs,
2425
nixpkgs-pinned,
26+
nixpkgs-unstable,
2527
flake-utils,
2628
drpc,
2729
pnpm2nix,
@@ -31,7 +33,7 @@
3133
let
3234
pkgs = import nixpkgs {
3335
inherit system;
34-
# Workaround for: terraform has an unfree license (‘bsl11’), refusing to evaluate.
36+
# Workaround for: google-chrome has an unfree license (‘unfree’), refusing to evaluate.
3537
config.allowUnfree = true;
3638
};
3739

@@ -41,6 +43,17 @@
4143
inherit system;
4244
};
4345

46+
unstablePkgs = import nixpkgs-unstable {
47+
inherit system;
48+
49+
# Workaround for: terraform has an unfree license (‘bsl11’), refusing to evaluate.
50+
config.allowUnfreePredicate =
51+
pkg:
52+
builtins.elem (pkgs.lib.getName pkg) [
53+
"terraform"
54+
];
55+
};
56+
4457
formatter = pkgs.nixfmt-rfc-style;
4558

4659
nodejs = pkgs.nodejs_20;
@@ -148,7 +161,7 @@
148161
shellcheck
149162
(pinnedPkgs.shfmt)
150163
sqlc
151-
terraform
164+
unstablePkgs.terraform
152165
typos
153166
which
154167
# Needed for many LD system libs!
@@ -185,7 +198,7 @@
185198
name = "coder-${osArch}";
186199
# Updated with ./scripts/update-flake.sh`.
187200
# This should be updated whenever go.mod changes!
188-
vendorHash = "sha256-QjqF+QZ5JKMnqkpNh6ZjrJU2QcSqiT4Dip1KoicwLYc=";
201+
vendorHash = "sha256-6sdvX0Wglj0CZiig2VD45JzuTcxwg7yrGoPPQUYvuqU=";
189202
proxyVendor = true;
190203
src = ./.;
191204
nativeBuildInputs = with pkgs; [

0 commit comments

Comments
 (0)