Skip to content

Conversation

@MartinNikov
Copy link
Contributor

No description provided.

@github-actions
Copy link
Contributor

Thanks for your Pull Request!

Below you will find a summary of the cachix status of each package, for each supported platform.

package x86_64-linux x86_64-darwin aarch64-darwin
cachix ❌ build failed ❌ build failed ❌ build failed
dcd ✅ cached 🚫 not supported 🚫 not supported
dmd ✅ cached 🚫 not supported 🚫 not supported
dscanner ✅ cached 🚫 not supported 🚫 not supported
dub ✅ cached ✅ cached ✅ cached
folder-size-metrics ✅ cached 🚫 not supported 🚫 not supported
foundry ✅ cached ✅ cached ✅ cached
geth ✅ cached 🚫 not supported ✅ cached
ldc ✅ cached 🚫 not supported 🚫 not supported
lido-withdrawals-automation ✅ cached ✅ cached ✅ cached
mcl ✅ cached 🚫 not supported 🚫 not supported
mev-boost ✅ cached 🚫 not supported 🚫 not supported
nethermind ✅ cached 🚫 not supported 🚫 not supported
nimbus ✅ cached 🚫 not supported 🚫 not supported
nix ❌ build failed ❌ build failed ❌ build failed
nix-eval-jobs ❌ build failed ❌ build failed ❌ build failed
nix-fast-build ❌ build failed ❌ build failed ❌ build failed
pyroscope ✅ cached ✅ cached ✅ cached
random-alerts ✅ cached ✅ cached ✅ cached
rustToolchain ✅ cached ✅ cached ✅ cached
secret ✅ cached 🚫 not supported ✅ cached
serve-d ✅ cached 🚫 not supported 🚫 not supported
terraform ✅ cached 🚫 not supported 🚫 not supported
terranix ✅ cached 🚫 not supported 🚫 not supported
web3signer ✅ cached 🚫 not supported 🚫 not supported

Comment on lines -37 to +53
${{ inputs.nix-github-token != '' && format('access-tokens = github.com={0}', inputs.nix-github-token) || '' }}
${{
(inputs.nix-github-token != '' && inputs.nix-gitlab-token != '' && inputs.nix-gitlab-domain != '' &&
format('access-tokens = github.com={0} {1}=PAT:{2}', inputs.nix-github-token, inputs.nix-gitlab-domain, inputs.nix-gitlab-token)) ||
(inputs.nix-github-token != '' &&
format('access-tokens = github.com={0}', inputs.nix-github-token)) ||
(inputs.nix-gitlab-token != '' && inputs.nix-gitlab-domain != '' &&
format('access-tokens = {0}=PAT:{1}', inputs.nix-gitlab-domain, inputs.nix-gitlab-token)) ||
''
}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion

- name: Configure Nix
  shell: bash
  run: |
    mkdir -p "$HOME/.config/nix"

    access_tokens=""
    if [[ -n "${{ inputs.nix-github-token }}" && -n "${{ inputs.nix-gitlab-token }}" && -n "${{ inputs.nix-gitlab-domain }}" ]]; then
      access_tokens="access-tokens = github.com=${{ inputs.nix-github-token }} ${{ inputs.nix-gitlab-domain }}=PAT:${{ inputs.nix-gitlab-token }}"
    elif [[ -n "${{ inputs.nix-github-token }}" ]]; then
      access_tokens="access-tokens = github.com=${{ inputs.nix-github-token }}"
    elif [[ -n "${{ inputs.nix-gitlab-token }}" && -n "${{ inputs.nix-gitlab-domain }}" ]]; then
      access_tokens="access-tokens = ${{ inputs.nix-gitlab-domain }}=PAT:${{ inputs.nix-gitlab-token }}"
    fi

    cat > "$HOME/.config/nix/nix.conf" <<EOF
$access_tokens
allow-import-from-derivation = true
substituters = https://cache.nixos.org ${{ inputs.substituters }}
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ${{ inputs.trusted-public-keys }}
netrc-file = $HOME/.config/nix/netrc
EOF

    cat > "$HOME/.config/nix/netrc" <<EOF
machine ${{ inputs.cachix-cache }}.cachix.org password ${{ inputs.cachix-auth-token }}
EOF

You can update the whole run clause with this above.
This version is easier to read and modify without needing to mentally parse a long ternary chain.

Note: I have not tested it. Be conscious if you decide to use it.

@PetarKirov PetarKirov merged commit b35a1bb into main Jul 24, 2025
23 checks passed
@PetarKirov PetarKirov deleted the config/github/install-nix branch July 24, 2025 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants