Skip to content

Commit 4947f52

Browse files
jfrocheyvan-sraka
authored andcommitted
fix: configure runner according to the matrix job
The matrix job returns the type of runner, so we can configure the nix installation step accordingly.
1 parent 31be73a commit 4947f52

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

.github/actions/nix-install-ephemeral/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ runs:
4242
install_url: https://releases.nixos.org/nix/nix-2.31.2/install
4343
extra_nix_config: |
4444
substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com
45-
trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
45+
trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
4646
${{ inputs.push-to-cache == 'true' && 'post-build-hook = /etc/nix/upload-to-cache.sh' || '' }}

.github/workflows/nix-build.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@ jobs:
3535
steps:
3636
- name: Checkout Repo
3737
uses: actions/checkout@v4
38-
- name: Build Nix Package
38+
- name: Install nix (ephemeral)
39+
if: ${{ matrix.runs_on.group != 'self-hosted-runners-nix' }}
40+
uses: ./.github/actions/nix-install-ephemeral
41+
env:
42+
DEV_AWS_ROLE: ${{ secrets.DEV_AWS_ROLE }}
43+
NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }}
44+
- name: Install nix (self-hosted)
45+
if: ${{ matrix.runs_on.group == 'self-hosted-runners-nix' }}
3946
uses: ./.github/actions/nix-install-self-hosted
4047
- name: nix build
4148
shell: bash
@@ -55,7 +62,7 @@ jobs:
5562
steps:
5663
- name: Checkout Repo
5764
uses: actions/checkout@v4
58-
- name: Build Nix Package
65+
- name: Install nix
5966
uses: ./.github/actions/nix-install-self-hosted
6067
- name: nix build
6168
shell: bash

.github/workflows/nix-eval.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
name: Generate Nix Matrix
3030
run: |
3131
set -Eeu
32-
echo matrix="$(nix run .\#github-matrix checks legacyPackages)" >> "$GITHUB_OUTPUT"
32+
echo matrix="$(nix run --accept-flake-config .\#github-matrix checks legacyPackages)" >> "$GITHUB_OUTPUT"

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
nixConfig = {
44
extra-substituters = [ "https://nix-postgres-artifacts.s3.amazonaws.com" ];
55
extra-trusted-public-keys = [
6-
"nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=%"
6+
"nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI="
77
];
88
};
99
inputs = {

0 commit comments

Comments
 (0)