mirror of
https://github.com/DeterminateSystems/nix-installer-action.git
synced 2025-01-10 22:32:06 +01:00
Try writing to file
This commit is contained in:
parent
317936b794
commit
e7cc0afd1d
2 changed files with 7 additions and 8 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -17,7 +17,7 @@ jobs:
|
|||
logger: pretty
|
||||
log-directives: nix_installer=trace
|
||||
backtrace: full
|
||||
extra-conf: |-
|
||||
extra-conf: |
|
||||
experimental-features = impure-derivations
|
||||
- run: cat /etc/nix/nix.conf
|
||||
- name: echo $PATH
|
||||
|
|
13
action.yml
13
action.yml
|
@ -159,20 +159,19 @@ runs:
|
|||
echo "Set NIX_INSTALLER_NIX_PACKAGE_URL=$NIX_INSTALLER_NIX_PACKAGE_URL"
|
||||
fi
|
||||
|
||||
NIX_EXTRA_CONF=""
|
||||
NEWLINE='
|
||||
'
|
||||
NIX_EXTRA_CONF_FILE=/tmp/tmp.jvU0yFBwoanix-installer-extra-conf
|
||||
|
||||
if [ -n "${{ inputs.extra-conf }}" ]; then
|
||||
NIX_EXTRA_CONF="${{ inputs.extra-conf }}"
|
||||
echo "${{ inputs.extra-conf }}" | tee -a ${NIX_EXTRA_CONF_FILE}
|
||||
fi
|
||||
if [ -n "${{ inputs.github-token }}" ]; then
|
||||
NIX_EXTRA_CONF="${NIX_EXTRA_CONF:+$NIX_EXTRA_CONF$NEWLINE}access-tokens = github.com=${{ inputs.github-token }}"
|
||||
echo "access-tokens = github.com=${{ inputs.github-token }}" | tee -a ${NIX_EXTRA_CONF_FILE}
|
||||
fi
|
||||
if [ "${{ inputs.trust-runner-user }}" == "true" ]; then
|
||||
NIX_EXTRA_CONF="${NIX_EXTRA_CONF:+$NIX_EXTRA_CONF$NEWLINE}trusted-users = root $USER"
|
||||
echo "trusted-users = root $USER" | tee -a ${NIX_EXTRA_CONF_FILE}
|
||||
fi
|
||||
if [ -n "$NIX_EXTRA_CONF" ]; then
|
||||
export NIX_INSTALLER_EXTRA_CONF="$NIX_EXTRA_CONF"
|
||||
export NIX_INSTALLER_EXTRA_CONF="$(cat NIX_EXTRA_CONF_FILE")"
|
||||
echo "Set NIX_INSTALLER_EXTRA_CONF=$NIX_INSTALLER_EXTRA_CONF"
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue