mirror of
https://github.com/cachix/install-nix-action.git
synced 2025-06-07 17:44:28 +00:00
add extra_nix_config options
This also cleans the install-nix.sh script a bit
This commit is contained in:
parent
3559d01d05
commit
dad23f2092
3 changed files with 17 additions and 5 deletions
|
@ -5,16 +5,25 @@ set -euo pipefail
|
|||
sudo sh -c 'echo max-jobs = auto >> /tmp/nix.conf'
|
||||
# Allow binary caches for runner user
|
||||
sudo sh -c 'echo trusted-users = root runner >> /tmp/nix.conf'
|
||||
if [[ -n $INPUT_EXTRA_NIX_CONFIG ]]; then
|
||||
echo "$INPUT_EXTRA_NIX_CONFIG" >> /tmp/nix.conf
|
||||
fi
|
||||
|
||||
if [[ $INPUT_SKIP_ADDING_NIXPKGS_CHANNEL = "true" || $INPUT_NIX_PATH != "" ]]; then
|
||||
extra_cmd=--no-channel-add
|
||||
install_options=(
|
||||
--daemon
|
||||
--daemon-user-count 4
|
||||
--nix-extra-conf-file /tmp/nix.conf
|
||||
--darwin-use-unencrypted-nix-store-volume
|
||||
)
|
||||
|
||||
if [[ $INPUT_SKIP_ADDING_NIXPKGS_CHANNEL = "true" || -n $INPUT_NIX_PATH ]]; then
|
||||
install_options+=(--no-channel-add)
|
||||
else
|
||||
extra_cmd=
|
||||
INPUT_NIX_PATH="/nix/var/nix/profiles/per-user/root/channels"
|
||||
fi
|
||||
|
||||
sh <(curl --retry 5 --retry-connrefused -L ${INPUT_INSTALL_URL:-https://nixos.org/nix/install}) \
|
||||
--daemon --daemon-user-count 4 --nix-extra-conf-file /tmp/nix.conf --darwin-use-unencrypted-nix-store-volume $extra_cmd
|
||||
sh <(curl --retry 5 --retry-connrefused -L "${INPUT_INSTALL_URL:-https://nixos.org/nix/install}") \
|
||||
"${install_options[@]}"
|
||||
|
||||
if [[ $OSTYPE =~ darwin ]]; then
|
||||
# Disable spotlight indexing of /nix to speed up performance
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue