mirror of
https://github.com/DeterminateSystems/nix-installer-action.git
synced 2025-01-10 22:32:06 +01:00
Add reinstall option
This commit is contained in:
parent
b2d55a56d7
commit
f0508f0de8
2 changed files with 43 additions and 1 deletions
30
.github/workflows/ci.yml
vendored
30
.github/workflows/ci.yml
vendored
|
@ -36,6 +36,21 @@ jobs:
|
||||||
run: nix-instantiate -E 'builtins.currentTime' --eval
|
run: nix-instantiate -E 'builtins.currentTime' --eval
|
||||||
if: success() || failure()
|
if: success() || failure()
|
||||||
shell: sh -l {0}
|
shell: sh -l {0}
|
||||||
|
- name: Install Nix again (noop)
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
logger: pretty
|
||||||
|
log-directives: nix_installer=trace
|
||||||
|
backtrace: full
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Reinstall Nix
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
logger: pretty
|
||||||
|
log-directives: nix_installer=trace
|
||||||
|
backtrace: full
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
reinstall: true
|
||||||
|
|
||||||
run-x86_64-darwin:
|
run-x86_64-darwin:
|
||||||
name: Run x86_64 Darwin
|
name: Run x86_64 Darwin
|
||||||
|
@ -71,4 +86,19 @@ jobs:
|
||||||
run: nix-instantiate -E 'builtins.currentTime' --eval
|
run: nix-instantiate -E 'builtins.currentTime' --eval
|
||||||
if: success() || failure()
|
if: success() || failure()
|
||||||
shell: zsh --login --interactive {0}
|
shell: zsh --login --interactive {0}
|
||||||
|
- name: Install Nix again (noop)
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
logger: pretty
|
||||||
|
log-directives: nix_installer=trace
|
||||||
|
backtrace: full
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Reinstall Nix
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
logger: pretty
|
||||||
|
log-directives: nix_installer=trace
|
||||||
|
backtrace: full
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
reinstall: true
|
||||||
|
|
14
action.yml
14
action.yml
|
@ -2,7 +2,7 @@ name: Nix Installer
|
||||||
branding:
|
branding:
|
||||||
icon: 'box'
|
icon: 'box'
|
||||||
color: 'purple'
|
color: 'purple'
|
||||||
description: An experimental Nix installer using `nix-install`
|
description: Install Nix
|
||||||
inputs:
|
inputs:
|
||||||
planner:
|
planner:
|
||||||
description: A planner to use
|
description: A planner to use
|
||||||
|
@ -75,6 +75,8 @@ inputs:
|
||||||
nix-installer-branch:
|
nix-installer-branch:
|
||||||
description: The branch of `nix-installer` to use
|
description: The branch of `nix-installer` to use
|
||||||
required: false
|
required: false
|
||||||
|
reinstall:
|
||||||
|
description: Force a reinstall if the
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
|
@ -82,6 +84,16 @@ runs:
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
if [ -f "/nix/receipt.json" ]; then
|
||||||
|
if [ -n "${{ inputs.reinstall }}" ]; then
|
||||||
|
/nix/nix-installer uninstall --no-confirm
|
||||||
|
else
|
||||||
|
echo "Nix was already installed, using existing install"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${{ inputs.nix-installer-tag }}" ]; then
|
if [ -n "${{ inputs.nix-installer-tag }}" ]; then
|
||||||
export NIX_INSTALLER_TAG=${{ inputs.tag }}
|
export NIX_INSTALLER_TAG=${{ inputs.tag }}
|
||||||
echo "Set NIX_INSTALLER_TAG=$NIX_INSTALLER_TAG"
|
echo "Set NIX_INSTALLER_TAG=$NIX_INSTALLER_TAG"
|
||||||
|
|
Loading…
Reference in a new issue