From 189b05c6d5ffd47f530f16da358ac0ed7b636c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Thu, 25 May 2023 20:02:33 +0100 Subject: [PATCH] Use auto-uid-allocate --- install-nix.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/install-nix.sh b/install-nix.sh index ee19c355..97b682fb 100755 --- a/install-nix.sh +++ b/install-nix.sh @@ -21,6 +21,7 @@ add_config() { add_config "max-jobs = auto" # Allow binary caches for user add_config "trusted-users = root ${USER:-}" +add_config "auto-allocate-uids = true" # Add github access token if [[ -n "${INPUT_GITHUB_ACCESS_TOKEN:-}" ]]; then add_config "access-tokens = github.com=$INPUT_GITHUB_ACCESS_TOKEN" @@ -32,7 +33,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 +47,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 0 ) + add_config "build-users-group =" else # "fix" the following error when running nix* # error: the group 'nixbld' specified in 'build-users-group' does not exist