diff --git a/action.yml b/action.yml index a108b19..41fd604 100644 --- a/action.yml +++ b/action.yml @@ -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 }} diff --git a/install-nix.sh b/install-nix.sh index 17b0980..53796b8 100755 --- a/install-nix.sh +++ b/install-nix.sh @@ -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)')"