option to install in single user mode

This commit is contained in:
Timothy DeHerrera 2022-04-21 15:47:32 -06:00
parent e17a164a72
commit 8e079717a1
No known key found for this signature in database
GPG Key ID: E44213186BC9AFE2
2 changed files with 4 additions and 1 deletions

View File

@ -6,6 +6,8 @@ inputs:
description: 'Installation URL that will contain a script to install Nix.'
install_options:
description: 'Additional installer flags passed to the installer script.'
single_user:
description: 'Install Nix in single-user mode'
nix_path:
description: 'Set NIX_PATH environment variable.'
extra_nix_config:
@ -23,3 +25,4 @@ runs:
INPUT_INSTALL_OPTIONS: ${{ inputs.install_options }}
INPUT_NIX_PATH: ${{ inputs.nix_path }}
INPUT_EXTRA_NIX_CONFIG: ${{ inputs.extra_nix_config }}
INPUT_SINGLE_USER: $${{ inputs.extra_nix_config }}

View File

@ -37,7 +37,7 @@ installer_options=(
)
# only use the nix-daemon settings if on darwin (which get ignored) or systemd is supported
if [[ $OSTYPE =~ darwin || -e /run/systemd/system ]]; then
if [[ $OSTYPE =~ darwin || -e /run/systemd/system && $INPUT_SINGLE_USER == "true" ]]; then
installer_options+=(
--daemon
--daemon-user-count "$(python3 -c 'import multiprocessing as mp; print(mp.cpu_count() * 2)')"