From a4df497e8e34d669f88b01d777739aeaef1dd489 Mon Sep 17 00:00:00 2001 From: Defelo Date: Fri, 17 Oct 2025 15:44:22 +0200 Subject: [PATCH] feat: add EXTRA_NIX_CONFIG variable --- .github/actions/setup-nix/action.yml | 4 ++++ .github/workflows/build.yml | 1 + .github/workflows/review.yml | 1 + README.md | 9 +++++++++ 4 files changed, 15 insertions(+) diff --git a/.github/actions/setup-nix/action.yml b/.github/actions/setup-nix/action.yml index 4ed924e..45c5bfe 100644 --- a/.github/actions/setup-nix/action.yml +++ b/.github/actions/setup-nix/action.yml @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5184beb..af60c3c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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' diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml index efd1d7a..fa19381 100644 --- a/.github/workflows/review.yml +++ b/.github/workflows/review.yml @@ -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' diff --git a/README.md b/README.md index 669289c..aa08041 100644 --- a/README.md +++ b/README.md @@ -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.