Skip to content

Commit

Permalink
Merge pull request #7 from antifuchs/extra-nix-config-input
Browse files Browse the repository at this point in the history
Add an extra nix config parameter
  • Loading branch information
samueldr authored Feb 28, 2025
2 parents 454ca28 + 704986d commit 8957043
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./
with:
extra_nix_config: |
extra-access-tokens = example.com=lix-gha-installer-extra-config-works
- name: Printing some useful info
shell: bash
run: |
Expand All @@ -36,5 +39,6 @@ jobs:
run: |
(
set -eux -o pipefail
nix --extra-experimental-features nix-command config show | grep lix-gha-installer-extra-config-works
echo "pp RUBY_DESCRIPTION" | nix-shell -p ruby --run ruby
)
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ By default, the `github.token` is configured. See https://docs.github.com/en/act
for a description of the default token's permissions.


### `extra_nix_config`

Additional configuration text to append to nix.conf. See https://docs.lix.systems/manual/lix/2.90/command-ref/conf-file.html
for a description of the config file format.


<!-- ACTION.YML INPUTS END -->

---
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ inputs:
By default, the `github.token` is configured. See https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
for a description of the default token's permissions.
extra_nix_config:
description: |
Additional configuration text to append to nix.conf. See https://docs.lix.systems/manual/lix/2.90/command-ref/conf-file.html
for a description of the config file format.
runs:
using: "composite"
steps:
Expand All @@ -16,3 +20,4 @@ runs:
env:
INPUT_GITHUB_ACCESS_TOKEN: "${{inputs.github_access_token}}"
GITHUB_TOKEN: "${{github.token}}"
INPUT_EXTRA_CONFIG: "${{inputs.extra_nix_config}}"
1 change: 1 addition & 0 deletions do-the-lix-thing
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ curl -sSf -L https://install.lix.systems/lix | bash -s -- install --no-confirm
printf "extra-access-tokens = github.com=%s\n" "${INPUT_GITHUB_ACCESS_TOKEN}"
fi
printf "trusted-users = root %s\n" "${USER:-}"
echo "${INPUT_EXTRA_CONFIG:-}"
) > tmp.conf
sudo mv -v tmp.conf /etc/nix/nix.conf
)
Expand Down

0 comments on commit 8957043

Please sign in to comment.