Skip to content

Commit

Permalink
use extra-conf instead of independent nix.conf
Browse files Browse the repository at this point in the history
Signed-off-by: Thing-han, Lim <[email protected]>
  • Loading branch information
potsrevennil committed Sep 18, 2024
1 parent 16d90d5 commit 00b2cfe
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions .github/actions/setup-nix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,27 @@ inputs:
runs:
using: composite
steps:
- name: Check nix
id: check-nix
- name: Pre-check nix
id: pre-check-nix
continue-on-error: true
shell: bash
run: |
nix --version
nix show-config | grep -E "^trusted-users = .*$USER"
nix show-config | grep -E "^experimental-features = .*flakes"
nix show-config | grep -E "^experimental-features = .*nix-command"
nix config show | grep -E "^trusted-users = .*$USER"
nix config show | grep -E "^experimental-features = .*flakes"
nix config show | grep -E "^experimental-features = .*nix-command"
- name: Install nix
if: steps.check-nix.outcome != 'success'
if: steps.pre-check-nix.outcome != 'success'
shell: bash
run: |
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm
echo "trusted-users = root ${USER:-}" >> nix.conf
echo "experimental-features = nix-command flakes" >> nix.conf
sudo mkdir -p /etc/nix
sudo chmod 0755 /etc/nix
sudo cp nix.conf /etc/nix/nix.conf
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \
--extra-conf "trusted-users = root ${USER:-}" \
--extra-conf "experimental-features = nix-command flakes" \
- name: Post-check nix
shell: bash
run: |
nix config check
- uses: DeterminateSystems/magic-nix-cache-action@v8
- name: Prepare nix dev shell
shell: nix develop --quiet .#${{ inputs.devShell }} -c bash -e {0}
Expand Down

0 comments on commit 00b2cfe

Please sign in to comment.