Compare commits

..

13 Commits

Author SHA1 Message Date
Ana Hobden c67dd30e67 Is it fixed on main 2023-06-27 09:48:49 -07:00
Ana Hobden 0897b85290 Missed a rename in the if statement 2023-06-27 09:39:09 -07:00
Ana Hobden cc23aa2fec Remove unnecessary quotes 2023-06-27 09:37:51 -07:00
Ana Hobden 56ecdbd741 Whoops did not save 2023-06-27 09:36:19 -07:00
Ana Hobden e7cc0afd1d Try writing to file 2023-06-27 09:33:06 -07:00
Ana Hobden 317936b794 Does it work with block chomping 2023-06-27 09:10:37 -07:00
Ana Hobden 710f8bd079 Test simpler yaml string 2023-06-27 08:54:28 -07:00
Ana Hobden 1928ffb7dd Add extra-conf test 2023-06-27 08:31:35 -07:00
Ana Hobden 129f079024 Merge pull request #22 from DeterminateSystems/v0.9.0-changes
v0.9.0 - nix profile location change
2023-05-25 09:57:30 -07:00
Ana Hobden 23314a8041 Merge branch 'use-not-fortune' into v0.9.0-changes 2023-05-25 09:32:35 -07:00
Ana Hobden cd77c17f59 Maybe we can use hello 2023-05-25 08:54:25 -07:00
Ana Hobden 10f7447de7 Use ripgrep instead of fortune 2023-05-25 08:53:32 -07:00
Ana Hobden e46eb0b82c v0.9.0 - nix profile location change 2023-05-24 09:46:04 -07:00
2 changed files with 36 additions and 32 deletions
+28 -24
View File
@@ -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
View File
@@ -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