Merge pull request #7925 from cole-h/fixup-xdg-nix-env
Check if NIX_LINK_NEW exists instead of checking that NIX_LINK doesn't exist
This commit is contained in:
commit
ffadc35df1
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
|
@ -20,6 +20,8 @@ jobs:
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: cachix/install-nix-action@v19
|
- uses: cachix/install-nix-action@v19
|
||||||
|
with:
|
||||||
|
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
|
||||||
- run: echo CACHIX_NAME="$(echo $GITHUB_REPOSITORY-install-tests | tr "[A-Z]/" "[a-z]-")" >> $GITHUB_ENV
|
- run: echo CACHIX_NAME="$(echo $GITHUB_REPOSITORY-install-tests | tr "[A-Z]/" "[a-z]-")" >> $GITHUB_ENV
|
||||||
- uses: cachix/cachix-action@v12
|
- uses: cachix/cachix-action@v12
|
||||||
if: needs.check_secrets.outputs.cachix == 'true'
|
if: needs.check_secrets.outputs.cachix == 'true'
|
||||||
|
@ -59,6 +61,8 @@ jobs:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- run: echo CACHIX_NAME="$(echo $GITHUB_REPOSITORY-install-tests | tr "[A-Z]/" "[a-z]-")" >> $GITHUB_ENV
|
- run: echo CACHIX_NAME="$(echo $GITHUB_REPOSITORY-install-tests | tr "[A-Z]/" "[a-z]-")" >> $GITHUB_ENV
|
||||||
- uses: cachix/install-nix-action@v19
|
- uses: cachix/install-nix-action@v19
|
||||||
|
with:
|
||||||
|
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
|
||||||
- uses: cachix/cachix-action@v12
|
- uses: cachix/cachix-action@v12
|
||||||
with:
|
with:
|
||||||
name: '${{ env.CACHIX_NAME }}'
|
name: '${{ env.CACHIX_NAME }}'
|
||||||
|
@ -103,6 +107,8 @@ jobs:
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: cachix/install-nix-action@v19
|
- uses: cachix/install-nix-action@v19
|
||||||
|
with:
|
||||||
|
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
|
||||||
- run: echo CACHIX_NAME="$(echo $GITHUB_REPOSITORY-install-tests | tr "[A-Z]/" "[a-z]-")" >> $GITHUB_ENV
|
- run: echo CACHIX_NAME="$(echo $GITHUB_REPOSITORY-install-tests | tr "[A-Z]/" "[a-z]-")" >> $GITHUB_ENV
|
||||||
- run: echo NIX_VERSION="$(nix --experimental-features 'nix-command flakes' eval .\#default.version | tr -d \")" >> $GITHUB_ENV
|
- run: echo NIX_VERSION="$(nix --experimental-features 'nix-command flakes' eval .\#default.version | tr -d \")" >> $GITHUB_ENV
|
||||||
- uses: cachix/cachix-action@v12
|
- uses: cachix/cachix-action@v12
|
||||||
|
|
|
@ -8,7 +8,7 @@ if [ -n "${XDG_STATE_HOME-}" ]; then
|
||||||
else
|
else
|
||||||
NIX_LINK_NEW=$HOME/.local/state/nix/profile
|
NIX_LINK_NEW=$HOME/.local/state/nix/profile
|
||||||
fi
|
fi
|
||||||
if ! [ -e "$NIX_LINK" ]; then
|
if [ -e "$NIX_LINK_NEW" ]; then
|
||||||
NIX_LINK="$NIX_LINK_NEW"
|
NIX_LINK="$NIX_LINK_NEW"
|
||||||
else
|
else
|
||||||
if [ -t 2 ] && [ -e "$NIX_LINK_NEW" ]; then
|
if [ -t 2 ] && [ -e "$NIX_LINK_NEW" ]; then
|
||||||
|
|
|
@ -8,7 +8,7 @@ if [ -n "$HOME" ] && [ -n "$USER" ]; then
|
||||||
else
|
else
|
||||||
NIX_LINK_NEW="$HOME/.local/state/nix/profile"
|
NIX_LINK_NEW="$HOME/.local/state/nix/profile"
|
||||||
fi
|
fi
|
||||||
if ! [ -e "$NIX_LINK" ]; then
|
if [ -e "$NIX_LINK_NEW" ]; then
|
||||||
NIX_LINK="$NIX_LINK_NEW"
|
NIX_LINK="$NIX_LINK_NEW"
|
||||||
else
|
else
|
||||||
if [ -t 2 ] && [ -e "$NIX_LINK_NEW" ]; then
|
if [ -t 2 ] && [ -e "$NIX_LINK_NEW" ]; then
|
||||||
|
|
Loading…
Reference in a new issue