Compare commits

...

7 Commits

Author SHA1 Message Date
e7eff97c99 Use auto-uid-allocate 2023-05-25 20:31:38 +01:00
4b933aa7eb Nix: 2.15.1 2023-05-24 13:31:13 +01:00
35806937f1 Merge pull request #179 from joergdw/fix-action-path
Fix action to make it work on custom containers;
2023-05-05 17:27:03 +01:00
3eb7a24508 Merge pull request #178 from cachix/docs/149
Document how to pass env vars to modern nix commands
2023-05-04 10:15:12 +01:00
b2f4229533 Fix action to make it work on custom containers;
For further information, see: <https://github.com/actions/runner/issues/716#issuecomment-795238933>
2023-05-03 17:02:20 +02:00
e304541747 fix #170 2023-05-01 13:29:04 +01:00
3988b729f9 pin Nix to 2.15.0 2023-05-01 13:27:11 +01:00
3 changed files with 9 additions and 8 deletions

View File

@ -16,7 +16,7 @@ jobs:
- name: Install Nix
uses: ./
with:
nix_path: nixpkgs=channel:nixos-20.03
nix_path: nixpkgs=channel:nixos-22.11
- run: nix-env -iA cachix -f https://cachix.org/api/v1/install
- run: cat /etc/nix/nix.conf
# cachix should be available and be able to configure a cache
@ -46,7 +46,7 @@ jobs:
- name: Install Nix
uses: ./
with:
nix_path: nixpkgs=channel:nixos-20.03
nix_path: nixpkgs=channel:nixos-22.11
extra_nix_config: |
sandbox = relaxed
- run: cat /etc/nix/nix.conf
@ -73,7 +73,7 @@ jobs:
- name: Install Nix
uses: ./
with:
nix_path: nixpkgs=channel:nixos-22.05
nix_path: nixpkgs=channel:nixos-22.11
install_options: --tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve
install_url: https://nixos-nix-install-tests.cachix.org/serve/s62m7lc0q0mz2mxxm9q0kkrcg90njzhq/install
- run: nix-build test.nix
@ -88,7 +88,7 @@ jobs:
- name: Install Nix
uses: ./
with:
nix_path: nixpkgs=channel:nixos-22.05
nix_path: nixpkgs=channel:nixos-22.11
install_url: https://releases.nixos.org/nix/nix-2.8.0/install
- run: nix-build test.nix

View File

@ -18,7 +18,7 @@ branding:
runs:
using: 'composite'
steps:
- run : ${{ github.action_path }}/install-nix.sh
- run : ${GITHUB_ACTION_PATH}/install-nix.sh
shell: bash
env:
INPUT_EXTRA_NIX_CONFIG: ${{ inputs.extra_nix_config }}

View File

@ -32,7 +32,7 @@ if [[ -n "${INPUT_EXTRA_NIX_CONFIG:-}" ]]; then
add_config "$INPUT_EXTRA_NIX_CONFIG"
fi
if [[ ! $INPUT_EXTRA_NIX_CONFIG =~ "experimental-features" ]]; then
add_config "experimental-features = nix-command flakes"
add_config "experimental-features = nix-command flakes auto-allocate-uids"
fi
# Nix installer flags
@ -46,8 +46,9 @@ installer_options=(
if [[ (! $INPUT_INSTALL_OPTIONS =~ "--no-daemon") && ($OSTYPE =~ darwin || -e /run/systemd/system) ]]; then
installer_options+=(
--daemon
--daemon-user-count "$(python3 -c 'import multiprocessing as mp; print(mp.cpu_count() * 2)')"
--daemon-user-count 1
)
add_config "auto-allocate-uids = true"
else
# "fix" the following error when running nix*
# error: the group 'nixbld' specified in 'build-users-group' does not exist
@ -66,7 +67,7 @@ echo "installer options: ${installer_options[*]}"
# There is --retry-on-errors, but only newer curl versions support that
curl_retries=5
while ! curl -sS -o "$workdir/install" -v --fail -L "${INPUT_INSTALL_URL:-https://nixos.org/nix/install}"
while ! curl -sS -o "$workdir/install" -v --fail -L "${INPUT_INSTALL_URL:-https://releases.nixos.org/nix/nix-2.15.1/install}"
do
sleep 1
((curl_retries--))