From 2fc50b7dbd3184b7ecfd0e607af816cb210b4ec2 Mon Sep 17 00:00:00 2001 From: Sandro Date: Mon, 23 Aug 2021 14:12:02 +0200 Subject: [PATCH 1/2] Only use nix-daemon when systemd is supported --- lib/install-nix.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/install-nix.sh b/lib/install-nix.sh index c424b022..c049fc07 100755 --- a/lib/install-nix.sh +++ b/lib/install-nix.sh @@ -21,12 +21,24 @@ fi # Nix installer flags installer_options=( - --daemon - --daemon-user-count 4 --no-channel-add --darwin-use-unencrypted-nix-store-volume --nix-extra-conf-file /tmp/nix.conf ) + +# only use the nix-daemon if systemd is supported +if [[ -e /run/systemd/system ]]; then + installer_options+=( + --daemon + --daemon-user-count 4 + ) +else + # "fix" the following error when running nix* + # error: the group 'nixbld' specified in 'build-users-group' does not exist + mkdir -m 0755 /etc/nix + echo "build-users-group =" > /etc/nix/nix.conf +fi + if [[ $INPUT_INSTALL_OPTIONS != "" ]]; then IFS=' ' read -r -a extra_installer_options <<< $INPUT_INSTALL_OPTIONS installer_options=("${extra_installer_options[@]}" "${installer_options[@]}") From 7dec9775e50ea623295f3d27c7a77a8006e14fc0 Mon Sep 17 00:00:00 2001 From: Sandro Date: Wed, 25 Aug 2021 19:15:46 +0200 Subject: [PATCH 2/2] Don't fall back to single user installation on darwin --- lib/install-nix.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/install-nix.sh b/lib/install-nix.sh index c049fc07..82b50f3f 100755 --- a/lib/install-nix.sh +++ b/lib/install-nix.sh @@ -26,8 +26,8 @@ installer_options=( --nix-extra-conf-file /tmp/nix.conf ) -# only use the nix-daemon if systemd is supported -if [[ -e /run/systemd/system ]]; then +# only use the nix-daemon settings if on darwin (which get ignored) or systemd is supported +if [[ $OSTYPE =~ darwin || -e /run/systemd/system ]]; then installer_options+=( --daemon --daemon-user-count 4