Skip to content

Commit a4df497

Browse files
committed
feat: add EXTRA_NIX_CONFIG variable
1 parent 14dae8f commit a4df497

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

.github/actions/setup-nix/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ inputs:
77
sandbox:
88
type: string
99
default: "true"
10+
extra-nix-config:
11+
type: string
12+
default: ""
1013

1114
runs:
1215
using: composite
@@ -51,6 +54,7 @@ runs:
5154
build-dir = /nix/build
5255
sandbox = ${{ inputs.sandbox }}
5356
system = ${{ inputs.system }}
57+
${{ inputs.extra-nix-config }}
5458
5559
- name: create build-dir
5660
shell: bash

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ jobs:
7575
- name: setup nix
7676
uses: ./.github/actions/setup-nix
7777
with:
78+
extra-nix-config: ${{ vars.EXTRA_NIX_CONFIG }}
7879
system: ${{ matrix.system }}
7980
sandbox: ${{
8081
(matrix.system == 'x86_64-darwin' && inputs.x86_64-darwin == 'yes_sandbox_false'

.github/workflows/review.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ jobs:
136136
- name: setup nix
137137
uses: ./.github/actions/setup-nix
138138
with:
139+
extra-nix-config: ${{ vars.EXTRA_NIX_CONFIG }}
139140
system: ${{ matrix.system }}
140141
sandbox: ${{
141142
(matrix.system == 'x86_64-darwin' && inputs.x86_64-darwin == 'yes_sandbox_false'

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ Follow these steps if you want nixpkgs-review-gha to push new packages to a [Cac
4343
2. [Create a new variable](../../settings/variables/actions/new) with the name `CACHIX_CACHE` and set it to the name of your Cachix cache.
4444
3. [Create a new secret](../../settings/secrets/actions/new) with the name `CACHIX_AUTH_TOKEN` and set its value to your auth token. If you are using a self-signed cache, you also need to create a `CACHIX_SIGNING_KEY` secret and set its value to your private signing key.
4545

46+
### Extra Nix Config (optional)
47+
If you have additional configuration you want to append to `/etc/nix/nix.conf`, you can [create a new variable](../../settings/variables/actions/new) with the name `EXTRA_NIX_CONFIG`.
48+
For example, if you want to configure nix to use additional substituters, set its value to the following:
49+
50+
```
51+
extra-substituters = https://nix-community.cachix.org
52+
extra-trusted-public-keys = nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
53+
```
54+
4655
### Shortcuts on nixpkgs PR pages (optional)
4756
Add [`shortcut.js`](shortcut.js) as a user script in your browser for `https://github.com/` for example using the [User JavaScript and CSS chrome extension](https://chromewebstore.google.com/detail/user-javascript-and-css/nbhcbdghjpllgmfilhnhkllmkecfmpld) or [Violentmonkey](https://violentmonkey.github.io/). Don't forget to update the `repo` constant at the top of the file to point to your fork.
4857

0 commit comments

Comments
 (0)