Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop the need for python by using nproc --all/hw.logicalcpu_max #186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion install-nix.sh
Expand Up @@ -46,11 +46,16 @@ installer_options=(
--nix-extra-conf-file "$workdir/nix.conf"
)

if [[ $OSTYPE =~ darwin ]]; then
dameon_user_count="$(sysctl -n hw.logicalcpu_max)"
else
dameon_user_count="$(nproc --all)"
fi
# only use the nix-daemon settings if on darwin (which get ignored) or systemd is supported
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 "$dameon_user_count"
)
else
# "fix" the following error when running nix*
Expand Down