From 8e079717a1270096d863f1c588bd0c595e6679b0 Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Thu, 21 Apr 2022 15:47:32 -0600 Subject: [PATCH] option to install in single user mode --- action.yml | 3 +++ install-nix.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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)')"