feat: add EXTRA_NIX_CONFIG variable

This commit is contained in:
Defelo 2025-10-17 15:44:22 +02:00
commit a4df497e8e
No known key found for this signature in database
4 changed files with 15 additions and 0 deletions

View file

@ -7,6 +7,9 @@ inputs:
sandbox:
type: string
default: "true"
extra-nix-config:
type: string
default: ""
runs:
using: composite
@ -51,6 +54,7 @@ runs:
build-dir = /nix/build
sandbox = ${{ inputs.sandbox }}
system = ${{ inputs.system }}
${{ inputs.extra-nix-config }}
- name: create build-dir
shell: bash

View file

@ -75,6 +75,7 @@ jobs:
- name: setup nix
uses: ./.github/actions/setup-nix
with:
extra-nix-config: ${{ vars.EXTRA_NIX_CONFIG }}
system: ${{ matrix.system }}
sandbox: ${{
(matrix.system == 'x86_64-darwin' && inputs.x86_64-darwin == 'yes_sandbox_false'

View file

@ -136,6 +136,7 @@ jobs:
- name: setup nix
uses: ./.github/actions/setup-nix
with:
extra-nix-config: ${{ vars.EXTRA_NIX_CONFIG }}
system: ${{ matrix.system }}
sandbox: ${{
(matrix.system == 'x86_64-darwin' && inputs.x86_64-darwin == 'yes_sandbox_false'

View file

@ -43,6 +43,15 @@ Follow these steps if you want nixpkgs-review-gha to push new packages to a [Cac
2. [Create a new variable](../../settings/variables/actions/new) with the name `CACHIX_CACHE` and set it to the name of your Cachix cache.
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.
### Extra Nix Config (optional)
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`.
For example, if you want to configure nix to use additional substituters, set its value to the following:
```
extra-substituters = https://nix-community.cachix.org
extra-trusted-public-keys = nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
```
### Shortcuts on nixpkgs PR pages (optional)
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.