Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c67dd30e67 | |||
| 0897b85290 | |||
| cc23aa2fec | |||
| 56ecdbd741 | |||
| e7cc0afd1d | |||
| 317936b794 | |||
| 710f8bd079 | |||
| 1928ffb7dd | |||
| 129f079024 | |||
| 23314a8041 | |||
| cd77c17f59 | |||
| 10f7447de7 | |||
| e46eb0b82c |
+28
-24
@@ -17,16 +17,20 @@ jobs:
|
||||
logger: pretty
|
||||
log-directives: nix_installer=trace
|
||||
backtrace: full
|
||||
nix-installer-branch: main
|
||||
extra-conf: |
|
||||
experimental-features = impure-derivations
|
||||
- run: cat /etc/nix/nix.conf
|
||||
- name: echo $PATH
|
||||
run: echo $PATH
|
||||
- name: Test `nix` with `$GITHUB_PATH`
|
||||
if: success() || failure()
|
||||
run: |
|
||||
nix run nixpkgs#fortune
|
||||
nix profile install nixpkgs#fortune
|
||||
fortune
|
||||
nix run nixpkgs#hello
|
||||
nix profile install nixpkgs#hello
|
||||
hello
|
||||
nix store gc
|
||||
nix run nixpkgs#fortune
|
||||
nix run nixpkgs#hello
|
||||
- name: Test bash
|
||||
run: nix-instantiate -E 'builtins.currentTime' --eval
|
||||
if: success() || failure()
|
||||
@@ -44,11 +48,11 @@ jobs:
|
||||
- name: Test `nix` with `$GITHUB_PATH`
|
||||
if: success() || failure()
|
||||
run: |
|
||||
nix run nixpkgs#fortune
|
||||
nix profile install nixpkgs#fortune
|
||||
fortune
|
||||
nix run nixpkgs#hello
|
||||
nix profile install nixpkgs#hello
|
||||
hello
|
||||
nix store gc
|
||||
nix run nixpkgs#fortune
|
||||
nix run nixpkgs#hello
|
||||
- name: Reinstall Nix
|
||||
uses: ./
|
||||
with:
|
||||
@@ -61,11 +65,11 @@ jobs:
|
||||
- name: Test `nix` with `$GITHUB_PATH`
|
||||
if: success() || failure()
|
||||
run: |
|
||||
nix run nixpkgs#fortune
|
||||
nix profile install nixpkgs#fortune
|
||||
fortune
|
||||
nix run nixpkgs#hello
|
||||
nix profile install nixpkgs#hello
|
||||
hello
|
||||
nix store gc
|
||||
nix run nixpkgs#fortune
|
||||
nix run nixpkgs#hello
|
||||
- name: Verify the generated nix.conf
|
||||
run: |
|
||||
cat -n /etc/nix/nix.conf
|
||||
@@ -88,11 +92,11 @@ jobs:
|
||||
- name: Test `nix` with `$GITHUB_PATH`
|
||||
if: success() || failure()
|
||||
run: |
|
||||
nix run nixpkgs#fortune
|
||||
nix profile install nixpkgs#fortune
|
||||
fortune
|
||||
nix run nixpkgs#hello
|
||||
nix profile install nixpkgs#hello
|
||||
hello
|
||||
nix store gc
|
||||
nix run nixpkgs#fortune
|
||||
nix run nixpkgs#hello
|
||||
- name: Test bash
|
||||
run: nix-instantiate -E 'builtins.currentTime' --eval
|
||||
if: success() || failure()
|
||||
@@ -114,11 +118,11 @@ jobs:
|
||||
- name: Test `nix` with `$GITHUB_PATH`
|
||||
if: success() || failure()
|
||||
run: |
|
||||
nix run nixpkgs#fortune
|
||||
nix profile install nixpkgs#fortune
|
||||
fortune
|
||||
nix run nixpkgs#hello
|
||||
nix profile install nixpkgs#hello
|
||||
hello
|
||||
nix store gc
|
||||
nix run nixpkgs#fortune
|
||||
nix run nixpkgs#hello
|
||||
- name: Reinstall Nix
|
||||
uses: ./
|
||||
with:
|
||||
@@ -131,11 +135,11 @@ jobs:
|
||||
- name: Test `nix` with `$GITHUB_PATH`
|
||||
if: success() || failure()
|
||||
run: |
|
||||
nix run nixpkgs#fortune
|
||||
nix profile install nixpkgs#fortune
|
||||
fortune
|
||||
nix run nixpkgs#hello
|
||||
nix profile install nixpkgs#hello
|
||||
hello
|
||||
nix store gc
|
||||
nix run nixpkgs#fortune
|
||||
nix run nixpkgs#hello
|
||||
- name: Verify the generated nix.conf
|
||||
run: |
|
||||
cat -n /etc/nix/nix.conf
|
||||
|
||||
+8
-8
@@ -119,6 +119,7 @@ runs:
|
||||
fi
|
||||
echo "Nix was already installed, using existing install"
|
||||
echo "/nix/var/nix/profiles/default/bin" >> $GITHUB_PATH
|
||||
echo "$HOME/.nix-profile/bin" >> $GITHUB_PATH
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
@@ -158,20 +159,19 @@ runs:
|
||||
echo "Set NIX_INSTALLER_NIX_PACKAGE_URL=$NIX_INSTALLER_NIX_PACKAGE_URL"
|
||||
fi
|
||||
|
||||
NIX_EXTRA_CONF=""
|
||||
NEWLINE='
|
||||
'
|
||||
NIX_EXTRA_CONF_FILE=$(mktemp --suffix=nix-installer-extra-conf)
|
||||
|
||||
if [ -n "${{ inputs.extra-conf }}" ]; then
|
||||
NIX_EXTRA_CONF="${{ inputs.extra-conf }}"
|
||||
echo "${{ inputs.extra-conf }}" >> ${NIX_EXTRA_CONF_FILE}
|
||||
fi
|
||||
if [ -n "${{ inputs.github-token }}" ]; then
|
||||
NIX_EXTRA_CONF="${NIX_EXTRA_CONF:+$NIX_EXTRA_CONF$NEWLINE}access-tokens = github.com=${{ inputs.github-token }}"
|
||||
echo "access-tokens = github.com=${{ inputs.github-token }}" >> ${NIX_EXTRA_CONF_FILE}
|
||||
fi
|
||||
if [ "${{ inputs.trust-runner-user }}" == "true" ]; then
|
||||
NIX_EXTRA_CONF="${NIX_EXTRA_CONF:+$NIX_EXTRA_CONF$NEWLINE}trusted-users = root $USER"
|
||||
echo "trusted-users = root $USER" >> ${NIX_EXTRA_CONF_FILE}
|
||||
fi
|
||||
if [ -n "$NIX_EXTRA_CONF" ]; then
|
||||
export NIX_INSTALLER_EXTRA_CONF="$NIX_EXTRA_CONF"
|
||||
if [ -n "$NIX_EXTRA_CONF_FILE" ]; then
|
||||
export NIX_INSTALLER_EXTRA_CONF=$(cat ${NIX_EXTRA_CONF_FILE})
|
||||
echo "Set NIX_INSTALLER_EXTRA_CONF=$NIX_INSTALLER_EXTRA_CONF"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user