mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-31 07:44:57 +08:00
48 lines
1.5 KiB
YAML
48 lines
1.5 KiB
YAML
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
name: Setup Nix
|
|
description: Install Determinate Nix, configure Cachix, and optionally prepare the development shell
|
|
|
|
inputs:
|
|
cachix-auth-token:
|
|
description: Token used to write build outputs to Cachix
|
|
required: false
|
|
default: ""
|
|
|
|
prepare-shell:
|
|
description: Prepare the development shell, retrying once on failure
|
|
required: false
|
|
default: "false"
|
|
shell-installable:
|
|
description: Development shell to prepare
|
|
required: false
|
|
default: "."
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- uses: DeterminateSystems/determinate-nix-action@e847f25223456b3058e12f7fc9d777b6a6f25060 # v3.23.2
|
|
with:
|
|
github-token: ${{ github.token }}
|
|
summarize: false
|
|
|
|
- uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
|
|
with:
|
|
name: openshell
|
|
authToken: ${{ inputs.cachix-auth-token }}
|
|
skipPush: ${{ inputs.cachix-auth-token == '' }}
|
|
|
|
- name: Prepare Nix development shell
|
|
if: inputs.prepare-shell == 'true'
|
|
shell: bash
|
|
env:
|
|
NIX_SHELL_INSTALLABLE: ${{ inputs.shell-installable }}
|
|
run: |
|
|
# HTTP 416 is not retried by Nix; a fresh invocation restarts downloads.
|
|
if nix develop "$NIX_SHELL_INSTALLABLE" -c true; then
|
|
exit 0
|
|
fi
|
|
echo "::warning::Nix shell preparation failed; retrying once."
|
|
nix develop "$NIX_SHELL_INSTALLABLE" -c true
|