From ee764e56519f76a66799702ce5719f3aab6493de Mon Sep 17 00:00:00 2001 From: TheSola10 Date: Tue, 11 Mar 2025 13:48:53 +0100 Subject: [PATCH] Introduce sysctl health checks for sandboxed Nix --- nix | 1446 +++++++++++++++++++++++++---------------------- src/nix.ab | 7 +- src/platform.ab | 34 ++ 3 files changed, 797 insertions(+), 690 deletions(-) diff --git a/nix b/nix index 93889f1..b5f2fca 100755 --- a/nix +++ b/nix @@ -111,16 +111,27 @@ fi __AF_file_exists33_v0=1; return 0 } +file_read__34_v0() { + local path=$1 + __AMBER_VAL_6=$( < "${path}" ); + __AS=$?; +if [ $__AS != 0 ]; then +__AF_file_read34_v0='' +return $__AS +fi; + __AF_file_read34_v0="${__AMBER_VAL_6}"; + return 0 +} file_write__35_v0() { local path=$1 local content=$2 - __AMBER_VAL_6=$( echo "${content}" > "${path}" ); + __AMBER_VAL_7=$( echo "${content}" > "${path}" ); __AS=$?; if [ $__AS != 0 ]; then __AF_file_write35_v0='' return $__AS fi; - __AF_file_write35_v0="${__AMBER_VAL_6}"; + __AF_file_write35_v0="${__AMBER_VAL_7}"; return 0 } dir_create__38_v0() { @@ -155,13 +166,13 @@ fi } env_var_get__91_v0() { local name=$1 - __AMBER_VAL_7=$( echo ${!name} ); + __AMBER_VAL_8=$( echo ${!name} ); __AS=$?; if [ $__AS != 0 ]; then __AF_env_var_get91_v0='' return $__AS fi; - __AF_env_var_get91_v0="${__AMBER_VAL_7}"; + __AF_env_var_get91_v0="${__AMBER_VAL_8}"; return 0 } is_command__93_v0() { @@ -185,18 +196,18 @@ printf__99_v0() { } echo_warning__108_v0() { local message=$1 - __AMBER_ARRAY_8=("${message}"); + __AMBER_ARRAY_9=("${message}"); printf__99_v0 "\x1b[1;3;97;43m%s\x1b[0m -" __AMBER_ARRAY_8[@]; +" __AMBER_ARRAY_9[@]; __AF_printf99_v0__157_5="$__AF_printf99_v0"; echo "$__AF_printf99_v0__157_5" > /dev/null 2>&1 } echo_error__109_v0() { local message=$1 local exit_code=$2 - __AMBER_ARRAY_9=("${message}"); + __AMBER_ARRAY_10=("${message}"); printf__99_v0 "\x1b[1;3;97;41m%s\x1b[0m -" __AMBER_ARRAY_9[@]; +" __AMBER_ARRAY_10[@]; __AF_printf99_v0__162_5="$__AF_printf99_v0"; echo "$__AF_printf99_v0__162_5" > /dev/null 2>&1 if [ $(echo ${exit_code} '>' 0 | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then @@ -215,15 +226,15 @@ array_pop__119_v0() { __AMBER_LEN=("${!__AMBER_ARRAY_array}"); local length="${#__AMBER_LEN[@]}" local index=$(echo ${length} '-' 1 | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') - eval "local __AMBER_ARRAY_GET_10_array=\"\${$array[${index}]}\""; - local element=$__AMBER_ARRAY_GET_10_array - local __SLICE_UPPER_12=${index}; - local __SLICE_OFFSET_13=0; - __SLICE_OFFSET_13=$((__SLICE_OFFSET_13 > 0 ? __SLICE_OFFSET_13 : 0)); - local __SLICE_LENGTH_14=$(eval "echo ${index} '-' $__SLICE_OFFSET_13 | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//'"); - __SLICE_LENGTH_14=$((__SLICE_LENGTH_14 > 0 ? __SLICE_LENGTH_14 : 0)); - eval "local __AMBER_ARRAY_GET_11_array=\"\${$array[@]:$__SLICE_OFFSET_13:$__SLICE_LENGTH_14}\""; - eval "${array}=($__AMBER_ARRAY_GET_11_array)" + eval "local __AMBER_ARRAY_GET_11_array=\"\${$array[${index}]}\""; + local element=$__AMBER_ARRAY_GET_11_array + local __SLICE_UPPER_13=${index}; + local __SLICE_OFFSET_14=0; + __SLICE_OFFSET_14=$((__SLICE_OFFSET_14 > 0 ? __SLICE_OFFSET_14 : 0)); + local __SLICE_LENGTH_15=$(eval "echo ${index} '-' $__SLICE_OFFSET_14 | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//'"); + __SLICE_LENGTH_15=$((__SLICE_LENGTH_15 > 0 ? __SLICE_LENGTH_15 : 0)); + eval "local __AMBER_ARRAY_GET_12_array=\"\${$array[@]:$__SLICE_OFFSET_14:$__SLICE_LENGTH_15}\""; + eval "${array}=($__AMBER_ARRAY_GET_12_array)" __AF_array_pop119_v0="${element}"; return 0 } @@ -232,30 +243,30 @@ array_shift__120_v0() { local array=$1 __AMBER_LEN=("${!__AMBER_ARRAY_array}"); local length="${#__AMBER_LEN[@]}" - eval "local __AMBER_ARRAY_GET_15_array=\"\${$array[0]}\""; - local element=$__AMBER_ARRAY_GET_15_array - local __SLICE_UPPER_17=${length}; - local __SLICE_OFFSET_18=1; - __SLICE_OFFSET_18=$((__SLICE_OFFSET_18 > 0 ? __SLICE_OFFSET_18 : 0)); - local __SLICE_LENGTH_19=$(eval "echo ${length} '-' $__SLICE_OFFSET_18 | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//'"); - __SLICE_LENGTH_19=$((__SLICE_LENGTH_19 > 0 ? __SLICE_LENGTH_19 : 0)); - eval "local __AMBER_ARRAY_GET_16_array=\"\${$array[@]:$__SLICE_OFFSET_18:$__SLICE_LENGTH_19}\""; - eval "${array}=($__AMBER_ARRAY_GET_16_array)" + eval "local __AMBER_ARRAY_GET_16_array=\"\${$array[0]}\""; + local element=$__AMBER_ARRAY_GET_16_array + local __SLICE_UPPER_18=${length}; + local __SLICE_OFFSET_19=1; + __SLICE_OFFSET_19=$((__SLICE_OFFSET_19 > 0 ? __SLICE_OFFSET_19 : 0)); + local __SLICE_LENGTH_20=$(eval "echo ${length} '-' $__SLICE_OFFSET_19 | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//'"); + __SLICE_LENGTH_20=$((__SLICE_LENGTH_20 > 0 ? __SLICE_LENGTH_20 : 0)); + eval "local __AMBER_ARRAY_GET_17_array=\"\${$array[@]:$__SLICE_OFFSET_19:$__SLICE_LENGTH_20}\""; + eval "${array}=($__AMBER_ARRAY_GET_17_array)" __AF_array_shift120_v0="${element}"; return 0 } -__AMBER_VAL_20=$(tput tsl); +__AMBER_VAL_21=$(tput tsl); __AS=$?; -__8_tsl="${__AMBER_VAL_20}" -__AMBER_VAL_21=$(tput fsl); +__8_tsl="${__AMBER_VAL_21}" +__AMBER_VAL_22=$(tput fsl); __AS=$?; -__9_fsl="${__AMBER_VAL_21}" -__AMBER_VAL_22=$(tput smcup); +__9_fsl="${__AMBER_VAL_22}" +__AMBER_VAL_23=$(tput smcup); __AS=$?; -__10_smcup="${__AMBER_VAL_22}" -__AMBER_VAL_23=$(tput rmcup); +__10_smcup="${__AMBER_VAL_23}" +__AMBER_VAL_24=$(tput rmcup); __AS=$?; -__11_rmcup="${__AMBER_VAL_23}" +__11_rmcup="${__AMBER_VAL_24}" env_var_get__91_v0 "TERM"; __AS=$?; __AF_env_var_get91_v0__13_18="${__AF_env_var_get91_v0}"; @@ -271,12 +282,12 @@ if [ $__AS != 0 ]; then TERM=xterm+sl tput hs; __AS=$? if [ $(echo $__AS '==' 0 | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - __AMBER_VAL_24=$(TERM=xterm+sl tput tsl); + __AMBER_VAL_25=$(TERM=xterm+sl tput tsl); __AS=$?; - __8_tsl="${__AMBER_VAL_24}" - __AMBER_VAL_25=$(TERM=xterm+sl tput fsl); + __8_tsl="${__AMBER_VAL_25}" + __AMBER_VAL_26=$(TERM=xterm+sl tput fsl); __AS=$?; - __9_fsl="${__AMBER_VAL_25}" + __9_fsl="${__AMBER_VAL_26}" else has_statusline=0 fi @@ -330,12 +341,12 @@ if [ "$__AF_text_contains14_v0__15_4" != 0 ]; then __AS=$?; __AF_env_var_get91_v0__17_25="${__AF_env_var_get91_v0}"; PWD="${__AF_env_var_get91_v0__17_25}" - __AMBER_VAL_26=$(readlink ${__14_me}); + __AMBER_VAL_27=$(readlink ${__14_me}); __AS=$?; if [ $__AS != 0 ]; then __13_SELF="${PWD}/${__14_me}" fi; - rl="${__AMBER_VAL_26}" + rl="${__AMBER_VAL_27}" starts_with__20_v0 "${rl}" "/"; __AF_starts_with20_v0__25_17="$__AF_starts_with20_v0"; if [ $([ "_${rl}" != "_" ]; echo $?) != 0 ]; then @@ -354,9 +365,9 @@ fi exists_newer__139_v0() { local left=$1 local right=$2 - __AMBER_VAL_27=$(stat -c %W ${left}); + __AMBER_VAL_28=$(stat -c %W ${left}); __AS=$?; - parse_number__12_v0 "${__AMBER_VAL_27}"; + parse_number__12_v0 "${__AMBER_VAL_28}"; __AS=$?; if [ $__AS != 0 ]; then __AF_exists_newer139_v0=0; @@ -364,9 +375,9 @@ if [ $__AS != 0 ]; then fi; __AF_parse_number12_v0__37_21="$__AF_parse_number12_v0"; local left_time="$__AF_parse_number12_v0__37_21" - __AMBER_VAL_28=$(stat -c %W ${right}); + __AMBER_VAL_29=$(stat -c %W ${right}); __AS=$?; - parse_number__12_v0 "${__AMBER_VAL_28}"; + parse_number__12_v0 "${__AMBER_VAL_29}"; __AS=$?; if [ $__AS != 0 ]; then __AF_exists_newer139_v0=0; @@ -403,9 +414,9 @@ get_self__141_v0() { return 0 } dump_archive__142_v0() { - __AMBER_VAL_29=$(mktemp -t nixie_XXXXXXXX.tar); + __AMBER_VAL_30=$(mktemp -t nixie_XXXXXXXX.tar); __AS=$?; - local dest="${__AMBER_VAL_29}" + local dest="${__AMBER_VAL_30}" cat ${__13_SELF} | ( read -r M while ! [[ "$M" =~ ^-----BEGIN\ ARCHIVE\ SECTION----- ]] @@ -434,7 +445,7 @@ untar__143_v0() { if [ ${dump} != 0 ]; then tar_cmd="tar -x -O ${member} -f ${archive}" fi - __AMBER_VAL_30=$(${tar_cmd}); + __AMBER_VAL_31=$(${tar_cmd}); __AS=$?; if [ $__AS != 0 ]; then local tar_status=$__AS @@ -443,7 +454,7 @@ if [ $__AS != 0 ]; then __AF_untar143_v0=''; return ${tar_status} fi; - local tar_out="${__AMBER_VAL_30}" + local tar_out="${__AMBER_VAL_31}" rm ${archive}; __AS=$? __AF_untar143_v0="${tar_out}"; @@ -451,14 +462,14 @@ fi; } check_deps__144_v0() { local deps=("${!1}") - __AMBER_ARRAY_31=(); - local missing=("${__AMBER_ARRAY_31[@]}") + __AMBER_ARRAY_32=(); + local missing=("${__AMBER_ARRAY_32[@]}") for dep in "${deps[@]}"; do is_command__93_v0 "${dep}"; __AF_is_command93_v0__136_16="$__AF_is_command93_v0"; if [ $(echo '!' "$__AF_is_command93_v0__136_16" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - __AMBER_ARRAY_32=("${dep}"); - missing+=("${__AMBER_ARRAY_32[@]}") + __AMBER_ARRAY_33=("${dep}"); + missing+=("${__AMBER_ARRAY_33[@]}") fi done if [ $(echo "${#missing[@]}" '>' 0 | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then @@ -477,90 +488,142 @@ done return 1 fi } -get_osname__154_v0() { - __AMBER_VAL_33=$(uname -s); +get_osname__155_v0() { + __AMBER_VAL_34=$(uname -s); __AS=$?; - __AF_get_osname154_v0="${__AMBER_VAL_33}"; + __AF_get_osname155_v0="${__AMBER_VAL_34}"; return 0 } -get_machine__155_v0() { - __AMBER_VAL_34=$(uname -m); +get_machine__156_v0() { + __AMBER_VAL_35=$(uname -m); __AS=$?; - local machine="${__AMBER_VAL_34}" + local machine="${__AMBER_VAL_35}" if [ $([ "_${machine}" != "_arm64" ]; echo $?) != 0 ]; then - __AF_get_machine155_v0="aarch64"; + __AF_get_machine156_v0="aarch64"; return 0 fi - __AF_get_machine155_v0="${machine}"; + __AF_get_machine156_v0="${machine}"; return 0 } -get_system__156_v0() { - get_osname__154_v0 ; - __AF_get_osname154_v0__33_18="${__AF_get_osname154_v0}"; - local osname="${__AF_get_osname154_v0__33_18}" - get_machine__155_v0 ; - __AF_get_machine155_v0__34_19="${__AF_get_machine155_v0}"; - local machine="${__AF_get_machine155_v0__34_19}" - __AF_get_system156_v0="${osname}.${machine}"; +get_system__157_v0() { + get_osname__155_v0 ; + __AF_get_osname155_v0__34_18="${__AF_get_osname155_v0}"; + local osname="${__AF_get_osname155_v0__34_18}" + get_machine__156_v0 ; + __AF_get_machine156_v0__35_19="${__AF_get_machine156_v0}"; + local machine="${__AF_get_machine156_v0__35_19}" + __AF_get_system157_v0="${osname}.${machine}"; return 0 } -get_nix_root__158_v0() { +get_nix_root__159_v0() { env_var_get__91_v0 "HOME"; __AS=$?; - __AF_env_var_get91_v0__52_26="${__AF_env_var_get91_v0}"; - local userhome="${__AF_env_var_get91_v0__52_26}" - get_osname__154_v0 ; - __AF_get_osname154_v0__53_18="${__AF_get_osname154_v0}"; - local osname="${__AF_get_osname154_v0__53_18}" + __AF_env_var_get91_v0__53_26="${__AF_env_var_get91_v0}"; + local userhome="${__AF_env_var_get91_v0__53_26}" + get_osname__155_v0 ; + __AF_get_osname155_v0__54_18="${__AF_get_osname155_v0}"; + local osname="${__AF_get_osname155_v0__54_18}" if [ $([ "_${osname}" != "_Darwin" ]; echo $?) != 0 ]; then - __AF_get_nix_root158_v0="${userhome}/Library/Nix"; + __AF_get_nix_root159_v0="${userhome}/Library/Nix"; return 0 else - __AF_get_nix_root158_v0="${userhome}/.local/share/nix/root"; + __AF_get_nix_root159_v0="${userhome}/.local/share/nix/root"; return 0 fi } -get_cache_root__159_v0() { +get_cache_root__160_v0() { env_var_get__91_v0 "HOME"; __AS=$?; - __AF_env_var_get91_v0__63_26="${__AF_env_var_get91_v0}"; - local userhome="${__AF_env_var_get91_v0__63_26}" - get_osname__154_v0 ; - __AF_get_osname154_v0__64_18="${__AF_get_osname154_v0}"; - local osname="${__AF_get_osname154_v0__64_18}" + __AF_env_var_get91_v0__64_26="${__AF_env_var_get91_v0}"; + local userhome="${__AF_env_var_get91_v0__64_26}" + get_osname__155_v0 ; + __AF_get_osname155_v0__65_18="${__AF_get_osname155_v0}"; + local osname="${__AF_get_osname155_v0__65_18}" if [ $([ "_${osname}" != "_Darwin" ]; echo $?) != 0 ]; then - __AF_get_cache_root159_v0="${userhome}/Library/Caches"; + __AF_get_cache_root160_v0="${userhome}/Library/Caches"; return 0 else - __AF_get_cache_root159_v0="${userhome}/.cache"; + __AF_get_cache_root160_v0="${userhome}/.cache"; return 0 fi } -get_repo_root__160_v0() { +get_repo_root__161_v0() { get_self__141_v0 ; - __AF_get_self141_v0__77_24="${__AF_get_self141_v0}"; - split__3_v0 "${__AF_get_self141_v0__77_24}" "/"; - __AF_split3_v0__77_18=("${__AF_split3_v0[@]}"); - local self_a=("${__AF_split3_v0__77_18[@]}") + __AF_get_self141_v0__78_24="${__AF_get_self141_v0}"; + split__3_v0 "${__AF_get_self141_v0__78_24}" "/"; + __AF_split3_v0__78_18=("${__AF_split3_v0[@]}"); + local self_a=("${__AF_split3_v0__78_18[@]}") array_pop__119_v0 self_a; - __AF_array_pop119_v0__78_5="${__AF_array_pop119_v0}"; - echo "${__AF_array_pop119_v0__78_5}" > /dev/null 2>&1 + __AF_array_pop119_v0__79_5="${__AF_array_pop119_v0}"; + echo "${__AF_array_pop119_v0__79_5}" > /dev/null 2>&1 join__6_v0 self_a[@] "/"; - __AF_join6_v0__80_26="${__AF_join6_v0}"; - local self_dir="/""${__AF_join6_v0__80_26}" - __AMBER_VAL_35=$(git -C ${self_dir} rev-parse --show-toplevel); + __AF_join6_v0__81_26="${__AF_join6_v0}"; + local self_dir="/""${__AF_join6_v0__81_26}" + __AMBER_VAL_36=$(git -C ${self_dir} rev-parse --show-toplevel); __AS=$?; if [ $__AS != 0 ]; then echo_warning__108_v0 "Failed to find current Git repository, using script parent directory."; - __AF_echo_warning108_v0__83_9="$__AF_echo_warning108_v0"; - echo "$__AF_echo_warning108_v0__83_9" > /dev/null 2>&1 - __AF_get_repo_root160_v0="${self_dir}"; + __AF_echo_warning108_v0__84_9="$__AF_echo_warning108_v0"; + echo "$__AF_echo_warning108_v0__84_9" > /dev/null 2>&1 + __AF_get_repo_root161_v0="${self_dir}"; return 0 fi; - __AF_get_repo_root160_v0="${__AMBER_VAL_35}"; + __AF_get_repo_root161_v0="${__AMBER_VAL_36}"; + return 0 +} +read_sysctl__162_v0() { + local path=$1 + file_read__34_v0 "/proc/sys/${path}" > /dev/null 2>&1; + __AS=$?; +if [ $__AS != 0 ]; then +__AF_read_sysctl162_v0='' +return $__AS +fi; + __AF_file_read34_v0__91_19="${__AF_file_read34_v0}"; + __AF_read_sysctl162_v0="${__AF_file_read34_v0__91_19}"; return 0 } -cmd_help__174_v0() { +check_sandbox__163_v0() { + get_osname__155_v0 ; + __AF_get_osname155_v0__98_18="${__AF_get_osname155_v0}"; + local osname="${__AF_get_osname155_v0__98_18}" + if [ $([ "_${osname}" != "_Linux" ]; echo $?) != 0 ]; then + read_sysctl__162_v0 "kernel/unprivileged_userns_clone"; + __AS=$?; + __AF_read_sysctl162_v0__102_18="${__AF_read_sysctl162_v0}"; + if [ $([ "_${__AF_read_sysctl162_v0__102_18}" != "_0" ]; echo $?) != 0 ]; then + echo_warning__108_v0 "Unprivileged sandboxes are not allowed on this system."; + __AF_echo_warning108_v0__103_13="$__AF_echo_warning108_v0"; + echo "$__AF_echo_warning108_v0__103_13" > /dev/null 2>&1 + echo_warning__108_v0 "Running the following command as root may fix the issue:"; + __AF_echo_warning108_v0__104_13="$__AF_echo_warning108_v0"; + echo "$__AF_echo_warning108_v0__104_13" > /dev/null 2>&1 + echo " sysctl kernel.unprivileged_userns_clone=1" + __AF_check_sandbox163_v0=0; + return 0 +fi + read_sysctl__162_v0 "kernel/apparmor_restrict_unprivileged_userns"; + __AS=$?; + __AF_read_sysctl162_v0__109_18="${__AF_read_sysctl162_v0}"; + if [ $([ "_${__AF_read_sysctl162_v0__109_18}" != "_1" ]; echo $?) != 0 ]; then + echo_warning__108_v0 "AppArmor is restricting unprivileged sandboxes on this system."; + __AF_echo_warning108_v0__110_13="$__AF_echo_warning108_v0"; + echo "$__AF_echo_warning108_v0__110_13" > /dev/null 2>&1 + echo_warning__108_v0 "Running the following command as root may fix the issue:"; + __AF_echo_warning108_v0__111_13="$__AF_echo_warning108_v0"; + echo "$__AF_echo_warning108_v0__111_13" > /dev/null 2>&1 + echo " sysctl kernel.apparmor_restrict_unprivileged_userns=0" + __AF_check_sandbox163_v0=0; + return 0 +fi +else + __AF_check_sandbox163_v0=1; + return 0 +fi + __AF_check_sandbox163_v0=1; + return 0 +} +cmd_help__177_v0() { env_var_get__91_v0 "NIXIE_VERSION"; __AS=$?; __AF_env_var_get91_v0__15_31="${__AF_env_var_get91_v0}"; @@ -575,14 +638,14 @@ cmd_help__174_v0() { echo " --nixie-ignore-system Behave as if Nix was not installed." exit 0 } -cmd_print_config__175_v0() { +cmd_print_config__178_v0() { untar__143_v0 "features" 1; __AS=$?; __AF_untar143_v0__32_16="${__AF_untar143_v0}"; echo "${__AF_untar143_v0__32_16}" exit 0 } -cmd_extract__176_v0() { +cmd_extract__179_v0() { dir_create__38_v0 "nixie"; __AF_dir_create38_v0__38_5="$__AF_dir_create38_v0"; echo "$__AF_dir_create38_v0__38_5" > /dev/null 2>&1 @@ -593,16 +656,16 @@ cmd_extract__176_v0() { echo "${__AF_untar143_v0__40_11}" > /dev/null 2>&1 exit 0 } -cmd_cleanup__177_v0() { - get_nix_root__158_v0 ; - __AF_get_nix_root158_v0__46_20="${__AF_get_nix_root158_v0}"; - local nix_root="${__AF_get_nix_root158_v0__46_20}" - get_cache_root__159_v0 ; - __AF_get_cache_root159_v0__47_22="${__AF_get_cache_root159_v0}"; - local cache_root="${__AF_get_cache_root159_v0__47_22}" - get_repo_root__160_v0 ; - __AF_get_repo_root160_v0__48_21="${__AF_get_repo_root160_v0}"; - local repo_root="${__AF_get_repo_root160_v0__48_21}" +cmd_cleanup__180_v0() { + get_nix_root__159_v0 ; + __AF_get_nix_root159_v0__46_20="${__AF_get_nix_root159_v0}"; + local nix_root="${__AF_get_nix_root159_v0__46_20}" + get_cache_root__160_v0 ; + __AF_get_cache_root160_v0__47_22="${__AF_get_cache_root160_v0}"; + local cache_root="${__AF_get_cache_root160_v0__47_22}" + get_repo_root__161_v0 ; + __AF_get_repo_root161_v0__48_21="${__AF_get_repo_root161_v0}"; + local repo_root="${__AF_get_repo_root161_v0__48_21}" echo "Removing local Nix channels and build files..." chmod -R +wx ${repo_root}/.nixie 2>/dev/null; __AS=$? @@ -618,7 +681,7 @@ cmd_cleanup__177_v0() { __AS=$? exit 0 } -opt_ignore_system__178_v0() { +opt_ignore_system__181_v0() { echo_warning__108_v0 "Ignoring system-wide Nix for testing purposes."; __AF_echo_warning108_v0__66_5="$__AF_echo_warning108_v0"; echo "$__AF_echo_warning108_v0__66_5" > /dev/null 2>&1 @@ -633,7 +696,7 @@ opt_ignore_system__178_v0() { __AF_env_var_set90_v0__69_11="$__AF_env_var_set90_v0"; echo "$__AF_env_var_set90_v0__69_11" > /dev/null 2>&1 } -opt_no_precompiled__179_v0() { +opt_no_precompiled__182_v0() { echo_warning__108_v0 "Ignoring precompiled binaries for testing purposes."; __AF_echo_warning108_v0__74_5="$__AF_echo_warning108_v0"; echo "$__AF_echo_warning108_v0__74_5" > /dev/null 2>&1 @@ -649,7 +712,7 @@ opt_no_precompiled__179_v0() { __AF_env_var_set90_v0__77_11="$__AF_env_var_set90_v0"; echo "$__AF_env_var_set90_v0__77_11" > /dev/null 2>&1 } -notfound__180_v0() { +notfound__183_v0() { local cmd=$1 env_var_get__91_v0 "0"; __AS=$?; @@ -659,44 +722,44 @@ notfound__180_v0() { __AF_echo_error109_v0__84_5="$__AF_echo_error109_v0"; echo "$__AF_echo_error109_v0__84_5" > /dev/null 2>&1 } -eval_cmd__181_v0() { +eval_cmd__184_v0() { local cmd=$1 if [ $([ "_${cmd}" != "_help" ]; echo $?) != 0 ]; then - cmd_help__174_v0 ; - __AF_cmd_help174_v0__90_34="$__AF_cmd_help174_v0"; - echo "$__AF_cmd_help174_v0__90_34" > /dev/null 2>&1 + cmd_help__177_v0 ; + __AF_cmd_help177_v0__90_34="$__AF_cmd_help177_v0"; + echo "$__AF_cmd_help177_v0__90_34" > /dev/null 2>&1 elif [ $([ "_${cmd}" != "_print-config" ]; echo $?) != 0 ]; then - cmd_print_config__175_v0 ; - __AF_cmd_print_config175_v0__91_34="$__AF_cmd_print_config175_v0"; - echo "$__AF_cmd_print_config175_v0__91_34" > /dev/null 2>&1 + cmd_print_config__178_v0 ; + __AF_cmd_print_config178_v0__91_34="$__AF_cmd_print_config178_v0"; + echo "$__AF_cmd_print_config178_v0__91_34" > /dev/null 2>&1 elif [ $([ "_${cmd}" != "_extract" ]; echo $?) != 0 ]; then - cmd_extract__176_v0 ; - __AF_cmd_extract176_v0__92_34="$__AF_cmd_extract176_v0"; - echo "$__AF_cmd_extract176_v0__92_34" > /dev/null 2>&1 + cmd_extract__179_v0 ; + __AF_cmd_extract179_v0__92_34="$__AF_cmd_extract179_v0"; + echo "$__AF_cmd_extract179_v0__92_34" > /dev/null 2>&1 elif [ $([ "_${cmd}" != "_cleanup" ]; echo $?) != 0 ]; then - cmd_cleanup__177_v0 ; - __AF_cmd_cleanup177_v0__93_34="$__AF_cmd_cleanup177_v0"; - echo "$__AF_cmd_cleanup177_v0__93_34" > /dev/null 2>&1 + cmd_cleanup__180_v0 ; + __AF_cmd_cleanup180_v0__93_34="$__AF_cmd_cleanup180_v0"; + echo "$__AF_cmd_cleanup180_v0__93_34" > /dev/null 2>&1 elif [ $([ "_${cmd}" != "_ignore-system" ]; echo $?) != 0 ]; then - opt_ignore_system__178_v0 ; - __AF_opt_ignore_system178_v0__94_34="$__AF_opt_ignore_system178_v0"; - echo "$__AF_opt_ignore_system178_v0__94_34" > /dev/null 2>&1 + opt_ignore_system__181_v0 ; + __AF_opt_ignore_system181_v0__94_34="$__AF_opt_ignore_system181_v0"; + echo "$__AF_opt_ignore_system181_v0__94_34" > /dev/null 2>&1 elif [ $([ "_${cmd}" != "_no-precompiled" ]; echo $?) != 0 ]; then - opt_no_precompiled__179_v0 ; - __AF_opt_no_precompiled179_v0__95_34="$__AF_opt_no_precompiled179_v0"; - echo "$__AF_opt_no_precompiled179_v0__95_34" > /dev/null 2>&1 + opt_no_precompiled__182_v0 ; + __AF_opt_no_precompiled182_v0__95_34="$__AF_opt_no_precompiled182_v0"; + echo "$__AF_opt_no_precompiled182_v0__95_34" > /dev/null 2>&1 else - notfound__180_v0 "${cmd}"; - __AF_notfound180_v0__96_15="$__AF_notfound180_v0"; - echo "$__AF_notfound180_v0__96_15" > /dev/null 2>&1 + notfound__183_v0 "${cmd}"; + __AF_notfound183_v0__96_15="$__AF_notfound183_v0"; + echo "$__AF_notfound183_v0__96_15" > /dev/null 2>&1 fi } -catch_args__182_v0() { +catch_args__185_v0() { local __AMBER_ARRAY_args="$1[@]" local args=$1 local local_args=("${!__AMBER_ARRAY_args}") - __AMBER_ARRAY_36=(); - eval "${args}=(\"\${__AMBER_ARRAY_36[@]}\")" + __AMBER_ARRAY_37=(); + eval "${args}=(\"\${__AMBER_ARRAY_37[@]}\")" for arg in "${local_args[@]}"; do local cmd="" starts_with__20_v0 "${arg}" "--nixie-"; @@ -706,16 +769,16 @@ catch_args__182_v0() { slice__22_v0 "${arg}" "${#__AMBER_LEN}" 0; __AF_slice22_v0__111_19="${__AF_slice22_v0}"; cmd="${__AF_slice22_v0__111_19}" - eval_cmd__181_v0 "${cmd}"; - __AF_eval_cmd181_v0__112_13="$__AF_eval_cmd181_v0"; - echo "$__AF_eval_cmd181_v0__112_13" > /dev/null 2>&1 + eval_cmd__184_v0 "${cmd}"; + __AF_eval_cmd184_v0__112_13="$__AF_eval_cmd184_v0"; + echo "$__AF_eval_cmd184_v0__112_13" > /dev/null 2>&1 else - __AMBER_ARRAY_37=("${arg}"); - eval "${args}+=(\"\${__AMBER_ARRAY_37[@]}\")" + __AMBER_ARRAY_38=("${arg}"); + eval "${args}+=(\"\${__AMBER_ARRAY_38[@]}\")" fi done } -file_download__233_v0() { +file_download__237_v0() { local url=$1 local path=$2 is_command__93_v0 "curl"; @@ -734,23 +797,23 @@ elif [ "$__AF_is_command93_v0__15_9" != 0 ]; then aria2c "${url}" -d "${path}" ; __AS=$? else - __AF_file_download233_v0=0; + __AF_file_download237_v0=0; return 0 fi - __AF_file_download233_v0=1; + __AF_file_download237_v0=1; return 0 } -cachix_url__239_v0() { +cachix_url__243_v0() { local derivation=$1 local member=$2 env_var_get__91_v0 "SOURCE_CACHE"; __AS=$?; __AF_env_var_get91_v0__13_30="${__AF_env_var_get91_v0}"; local SOURCE_CACHE="${__AF_env_var_get91_v0__13_30}" - __AF_cachix_url239_v0="https://${SOURCE_CACHE}/serve/${derivation}/${member}"; + __AF_cachix_url243_v0="https://${SOURCE_CACHE}/serve/${derivation}/${member}"; return 0 } -pull_binary__241_v0() { +pull_binary__245_v0() { local member=$1 local dest=$2 env_var_get__91_v0 "NIX_BINS_DERIVATION"; @@ -762,15 +825,15 @@ pull_binary__241_v0() { __AF_untar143_v0__86_23="${__AF_untar143_v0}"; local where="${__AF_untar143_v0__86_23}" if [ $(echo $__AS '!=' 0 | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - __AMBER_VAL_38=$(mktemp -t nixie_${member}_XXXXXXXX); + __AMBER_VAL_39=$(mktemp -t nixie_${member}_XXXXXXXX); __AS=$?; - local tmpf="${__AMBER_VAL_38}" - cachix_url__239_v0 "${NIX_BINS_DERIVATION}" "${member}"; - __AF_cachix_url239_v0__90_30="${__AF_cachix_url239_v0}"; - file_download__233_v0 "${__AF_cachix_url239_v0__90_30}" "${tmpf}"; - __AF_file_download233_v0__90_16="$__AF_file_download233_v0"; - if [ $(echo '!' "$__AF_file_download233_v0__90_16" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - __AF_pull_binary241_v0=''; + local tmpf="${__AMBER_VAL_39}" + cachix_url__243_v0 "${NIX_BINS_DERIVATION}" "${member}"; + __AF_cachix_url243_v0__90_30="${__AF_cachix_url243_v0}"; + file_download__237_v0 "${__AF_cachix_url243_v0__90_30}" "${tmpf}"; + __AF_file_download237_v0__90_16="$__AF_file_download237_v0"; + if [ $(echo '!' "$__AF_file_download237_v0__90_16" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then + __AF_pull_binary245_v0=''; return 1 fi where="${tmpf}" @@ -778,23 +841,23 @@ fi mv "${where}" "${dest}" __AS=$? } -__AMBER_VAL_39=$(tput tsl); +__AMBER_VAL_40=$(tput tsl); __AS=$?; -__15_tsl="${__AMBER_VAL_39}" -__AMBER_VAL_40=$(tput fsl); +__15_tsl="${__AMBER_VAL_40}" +__AMBER_VAL_41=$(tput fsl); __AS=$?; -__16_fsl="${__AMBER_VAL_40}" -__AMBER_VAL_41=$(tput smcup); +__16_fsl="${__AMBER_VAL_41}" +__AMBER_VAL_42=$(tput smcup); __AS=$?; -__17_smcup="${__AMBER_VAL_41}" -__AMBER_VAL_42=$(tput rmcup); +__17_smcup="${__AMBER_VAL_42}" +__AMBER_VAL_43=$(tput rmcup); __AS=$?; -__18_rmcup="${__AMBER_VAL_42}" +__18_rmcup="${__AMBER_VAL_43}" env_var_get__91_v0 "TERM"; __AS=$?; __AF_env_var_get91_v0__13_18="${__AF_env_var_get91_v0}"; __19_TERM="${__AF_env_var_get91_v0__13_18}" -can_set_title__258_v0() { +can_set_title__262_v0() { local has_statusline=1 tput hs; __AS=$?; @@ -805,12 +868,12 @@ if [ $__AS != 0 ]; then TERM=xterm+sl tput hs; __AS=$? if [ $(echo $__AS '==' 0 | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - __AMBER_VAL_43=$(TERM=xterm+sl tput tsl); + __AMBER_VAL_44=$(TERM=xterm+sl tput tsl); __AS=$?; - __15_tsl="${__AMBER_VAL_43}" - __AMBER_VAL_44=$(TERM=xterm+sl tput fsl); + __15_tsl="${__AMBER_VAL_44}" + __AMBER_VAL_45=$(TERM=xterm+sl tput fsl); __AS=$?; - __16_fsl="${__AMBER_VAL_44}" + __16_fsl="${__AMBER_VAL_45}" else has_statusline=0 fi @@ -818,34 +881,34 @@ else has_statusline=0 fi fi - __AF_can_set_title258_v0=${has_statusline}; + __AF_can_set_title262_v0=${has_statusline}; return 0 } -set_title__259_v0() { +set_title__263_v0() { local title=$1 - can_set_title__258_v0 ; - __AF_can_set_title258_v0__43_8="$__AF_can_set_title258_v0"; - if [ "$__AF_can_set_title258_v0__43_8" != 0 ]; then + can_set_title__262_v0 ; + __AF_can_set_title262_v0__43_8="$__AF_can_set_title262_v0"; + if [ "$__AF_can_set_title262_v0__43_8" != 0 ]; then echo "${__15_tsl}""${title}""${__16_fsl}" fi } -__AMBER_VAL_45=$(tput tsl); +__AMBER_VAL_46=$(tput tsl); __AS=$?; -__20_tsl="${__AMBER_VAL_45}" -__AMBER_VAL_46=$(tput fsl); +__20_tsl="${__AMBER_VAL_46}" +__AMBER_VAL_47=$(tput fsl); __AS=$?; -__21_fsl="${__AMBER_VAL_46}" -__AMBER_VAL_47=$(tput smcup); +__21_fsl="${__AMBER_VAL_47}" +__AMBER_VAL_48=$(tput smcup); __AS=$?; -__22_smcup="${__AMBER_VAL_47}" -__AMBER_VAL_48=$(tput rmcup); +__22_smcup="${__AMBER_VAL_48}" +__AMBER_VAL_49=$(tput rmcup); __AS=$?; -__23_rmcup="${__AMBER_VAL_48}" +__23_rmcup="${__AMBER_VAL_49}" env_var_get__91_v0 "TERM"; __AS=$?; __AF_env_var_get91_v0__13_18="${__AF_env_var_get91_v0}"; __24_TERM="${__AF_env_var_get91_v0__13_18}" -can_set_title__278_v0() { +can_set_title__283_v0() { local has_statusline=1 tput hs; __AS=$?; @@ -856,12 +919,12 @@ if [ $__AS != 0 ]; then TERM=xterm+sl tput hs; __AS=$? if [ $(echo $__AS '==' 0 | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - __AMBER_VAL_49=$(TERM=xterm+sl tput tsl); + __AMBER_VAL_50=$(TERM=xterm+sl tput tsl); __AS=$?; - __20_tsl="${__AMBER_VAL_49}" - __AMBER_VAL_50=$(TERM=xterm+sl tput fsl); + __20_tsl="${__AMBER_VAL_50}" + __AMBER_VAL_51=$(TERM=xterm+sl tput fsl); __AS=$?; - __21_fsl="${__AMBER_VAL_50}" + __21_fsl="${__AMBER_VAL_51}" else has_statusline=0 fi @@ -869,18 +932,18 @@ else has_statusline=0 fi fi - __AF_can_set_title278_v0=${has_statusline}; + __AF_can_set_title283_v0=${has_statusline}; return 0 } -set_title__279_v0() { +set_title__284_v0() { local title=$1 - can_set_title__278_v0 ; - __AF_can_set_title278_v0__43_8="$__AF_can_set_title278_v0"; - if [ "$__AF_can_set_title278_v0__43_8" != 0 ]; then + can_set_title__283_v0 ; + __AF_can_set_title283_v0__43_8="$__AF_can_set_title283_v0"; + if [ "$__AF_can_set_title283_v0__43_8" != 0 ]; then echo "${__20_tsl}""${title}""${__21_fsl}" fi } -exit_alt_buffer__281_v0() { +exit_alt_buffer__286_v0() { echo "${__23_rmcup}" } __25_SELF="" @@ -898,12 +961,12 @@ if [ "$__AF_text_contains14_v0__15_4" != 0 ]; then __AS=$?; __AF_env_var_get91_v0__17_25="${__AF_env_var_get91_v0}"; PWD="${__AF_env_var_get91_v0__17_25}" - __AMBER_VAL_51=$(readlink ${__26_me}); + __AMBER_VAL_52=$(readlink ${__26_me}); __AS=$?; if [ $__AS != 0 ]; then __25_SELF="${PWD}/${__26_me}" fi; - rl="${__AMBER_VAL_51}" + rl="${__AMBER_VAL_52}" starts_with__20_v0 "${rl}" "/"; __AF_starts_with20_v0__25_17="$__AF_starts_with20_v0"; if [ $([ "_${rl}" != "_" ]; echo $?) != 0 ]; then @@ -919,15 +982,15 @@ else __AF_echo_error109_v0__30_5="$__AF_echo_error109_v0"; echo "$__AF_echo_error109_v0__30_5" > /dev/null 2>&1 fi -bail__286_v0() { +bail__291_v0() { local message=$1 local archive=$2 - exit_alt_buffer__281_v0 ; - __AF_exit_alt_buffer281_v0__56_5="$__AF_exit_alt_buffer281_v0"; - echo "$__AF_exit_alt_buffer281_v0__56_5" > /dev/null 2>&1 - set_title__279_v0 ""; - __AF_set_title279_v0__57_5="$__AF_set_title279_v0"; - echo "$__AF_set_title279_v0__57_5" > /dev/null 2>&1 + exit_alt_buffer__286_v0 ; + __AF_exit_alt_buffer286_v0__56_5="$__AF_exit_alt_buffer286_v0"; + echo "$__AF_exit_alt_buffer286_v0__56_5" > /dev/null 2>&1 + set_title__284_v0 ""; + __AF_set_title284_v0__57_5="$__AF_set_title284_v0"; + echo "$__AF_set_title284_v0__57_5" > /dev/null 2>&1 echo_error__109_v0 "${message}" 0; __AF_echo_error109_v0__59_5="$__AF_echo_error109_v0"; echo "$__AF_echo_error109_v0__59_5" > /dev/null 2>&1 @@ -940,14 +1003,14 @@ fi kill -ABRT $$; __AS=$? } -get_self__287_v0() { - __AF_get_self287_v0="${__25_SELF}"; +get_self__292_v0() { + __AF_get_self292_v0="${__25_SELF}"; return 0 } -dump_archive__288_v0() { - __AMBER_VAL_52=$(mktemp -t nixie_XXXXXXXX.tar); +dump_archive__293_v0() { + __AMBER_VAL_53=$(mktemp -t nixie_XXXXXXXX.tar); __AS=$?; - local dest="${__AMBER_VAL_52}" + local dest="${__AMBER_VAL_53}" cat ${__25_SELF} | ( read -r M while ! [[ "$M" =~ ^-----BEGIN\ ARCHIVE\ SECTION----- ]] @@ -958,116 +1021,116 @@ dump_archive__288_v0() { __AS=$?; if [ $__AS != 0 ]; then if [ $(echo $__AS '!=' 2 | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - bail__286_v0 "Could not find the script's resource archive." 1; - __AF_bail286_v0__92_13="$__AF_bail286_v0"; - echo "$__AF_bail286_v0__92_13" > /dev/null 2>&1 + bail__291_v0 "Could not find the script's resource archive." 1; + __AF_bail291_v0__92_13="$__AF_bail291_v0"; + echo "$__AF_bail291_v0__92_13" > /dev/null 2>&1 fi fi - __AF_dump_archive288_v0="${dest}"; + __AF_dump_archive293_v0="${dest}"; return 0 } -untar__289_v0() { +untar__294_v0() { local member=$1 local dump=$2 - dump_archive__288_v0 ; - __AF_dump_archive288_v0__109_19="${__AF_dump_archive288_v0}"; - local archive="${__AF_dump_archive288_v0__109_19}" + dump_archive__293_v0 ; + __AF_dump_archive293_v0__109_19="${__AF_dump_archive293_v0}"; + local archive="${__AF_dump_archive293_v0__109_19}" local tar_cmd="tar -x ${member} -f ${archive}" if [ ${dump} != 0 ]; then tar_cmd="tar -x -O ${member} -f ${archive}" fi - __AMBER_VAL_53=$(${tar_cmd}); + __AMBER_VAL_54=$(${tar_cmd}); __AS=$?; if [ $__AS != 0 ]; then local tar_status=$__AS rm ${archive}; __AS=$? - __AF_untar289_v0=''; + __AF_untar294_v0=''; return ${tar_status} fi; - local tar_out="${__AMBER_VAL_53}" + local tar_out="${__AMBER_VAL_54}" rm ${archive}; __AS=$? - __AF_untar289_v0="${tar_out}"; + __AF_untar294_v0="${tar_out}"; return 0 } -get_osname__292_v0() { - __AMBER_VAL_54=$(uname -s); +get_osname__297_v0() { + __AMBER_VAL_55=$(uname -s); __AS=$?; - __AF_get_osname292_v0="${__AMBER_VAL_54}"; + __AF_get_osname297_v0="${__AMBER_VAL_55}"; return 0 } -get_dll_ext__295_v0() { - get_osname__292_v0 ; - __AF_get_osname292_v0__42_18="${__AF_get_osname292_v0}"; - local osname="${__AF_get_osname292_v0__42_18}" +get_dll_ext__300_v0() { + get_osname__297_v0 ; + __AF_get_osname297_v0__43_18="${__AF_get_osname297_v0}"; + local osname="${__AF_get_osname297_v0__43_18}" if [ $([ "_${osname}" != "_Darwin" ]; echo $?) != 0 ]; then - __AF_get_dll_ext295_v0="dylib"; + __AF_get_dll_ext300_v0="dylib"; return 0 else - __AF_get_dll_ext295_v0="so"; + __AF_get_dll_ext300_v0="so"; return 0 fi } -get_cache_root__297_v0() { +get_cache_root__302_v0() { env_var_get__91_v0 "HOME"; __AS=$?; - __AF_env_var_get91_v0__63_26="${__AF_env_var_get91_v0}"; - local userhome="${__AF_env_var_get91_v0__63_26}" - get_osname__292_v0 ; - __AF_get_osname292_v0__64_18="${__AF_get_osname292_v0}"; - local osname="${__AF_get_osname292_v0__64_18}" + __AF_env_var_get91_v0__64_26="${__AF_env_var_get91_v0}"; + local userhome="${__AF_env_var_get91_v0__64_26}" + get_osname__297_v0 ; + __AF_get_osname297_v0__65_18="${__AF_get_osname297_v0}"; + local osname="${__AF_get_osname297_v0__65_18}" if [ $([ "_${osname}" != "_Darwin" ]; echo $?) != 0 ]; then - __AF_get_cache_root297_v0="${userhome}/Library/Caches"; + __AF_get_cache_root302_v0="${userhome}/Library/Caches"; return 0 else - __AF_get_cache_root297_v0="${userhome}/.cache"; + __AF_get_cache_root302_v0="${userhome}/.cache"; return 0 fi } -get_repo_root__298_v0() { - get_self__287_v0 ; - __AF_get_self287_v0__77_24="${__AF_get_self287_v0}"; - split__3_v0 "${__AF_get_self287_v0__77_24}" "/"; - __AF_split3_v0__77_18=("${__AF_split3_v0[@]}"); - local self_a=("${__AF_split3_v0__77_18[@]}") +get_repo_root__303_v0() { + get_self__292_v0 ; + __AF_get_self292_v0__78_24="${__AF_get_self292_v0}"; + split__3_v0 "${__AF_get_self292_v0__78_24}" "/"; + __AF_split3_v0__78_18=("${__AF_split3_v0[@]}"); + local self_a=("${__AF_split3_v0__78_18[@]}") array_pop__119_v0 self_a; - __AF_array_pop119_v0__78_5="${__AF_array_pop119_v0}"; - echo "${__AF_array_pop119_v0__78_5}" > /dev/null 2>&1 + __AF_array_pop119_v0__79_5="${__AF_array_pop119_v0}"; + echo "${__AF_array_pop119_v0__79_5}" > /dev/null 2>&1 join__6_v0 self_a[@] "/"; - __AF_join6_v0__80_26="${__AF_join6_v0}"; - local self_dir="/""${__AF_join6_v0__80_26}" - __AMBER_VAL_55=$(git -C ${self_dir} rev-parse --show-toplevel); + __AF_join6_v0__81_26="${__AF_join6_v0}"; + local self_dir="/""${__AF_join6_v0__81_26}" + __AMBER_VAL_56=$(git -C ${self_dir} rev-parse --show-toplevel); __AS=$?; if [ $__AS != 0 ]; then echo_warning__108_v0 "Failed to find current Git repository, using script parent directory."; - __AF_echo_warning108_v0__83_9="$__AF_echo_warning108_v0"; - echo "$__AF_echo_warning108_v0__83_9" > /dev/null 2>&1 - __AF_get_repo_root298_v0="${self_dir}"; + __AF_echo_warning108_v0__84_9="$__AF_echo_warning108_v0"; + echo "$__AF_echo_warning108_v0__84_9" > /dev/null 2>&1 + __AF_get_repo_root303_v0="${self_dir}"; return 0 fi; - __AF_get_repo_root298_v0="${__AMBER_VAL_55}"; + __AF_get_repo_root303_v0="${__AMBER_VAL_56}"; return 0 } __27_step_current=1 -get_source_root__302_v0() { - get_repo_root__298_v0 ; - __AF_get_repo_root298_v0__38_21="${__AF_get_repo_root298_v0}"; - local repo_root="${__AF_get_repo_root298_v0__38_21}" - __AF_get_source_root302_v0="${repo_root}/.nixie/sources"; +get_source_root__309_v0() { + get_repo_root__303_v0 ; + __AF_get_repo_root303_v0__38_21="${__AF_get_repo_root303_v0}"; + local repo_root="${__AF_get_repo_root303_v0__38_21}" + __AF_get_source_root309_v0="${repo_root}/.nixie/sources"; return 0 } -cachix_url__312_v0() { +cachix_url__319_v0() { local derivation=$1 local member=$2 env_var_get__91_v0 "SOURCE_CACHE"; __AS=$?; __AF_env_var_get91_v0__13_30="${__AF_env_var_get91_v0}"; local SOURCE_CACHE="${__AF_env_var_get91_v0__13_30}" - __AF_cachix_url312_v0="https://${SOURCE_CACHE}/serve/${derivation}/${member}"; + __AF_cachix_url319_v0="https://${SOURCE_CACHE}/serve/${derivation}/${member}"; return 0 } -pull_source_file__313_v0() { +pull_source_file__320_v0() { local member=$1 local dest=$2 env_var_get__91_v0 "SOURCE_DERIVATION"; @@ -1079,10 +1142,10 @@ pull_source_file__313_v0() { env_var_test__87_v0 "_NIXIE_TESTING_SKIP_TARBALL"; __AF_env_var_test87_v0__36_12="$__AF_env_var_test87_v0"; if [ $(echo '!' "$__AF_env_var_test87_v0__36_12" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - untar__289_v0 "sources/${member}" 0; + untar__294_v0 "sources/${member}" 0; __AS=$?; - __AF_untar289_v0__37_23="${__AF_untar289_v0}"; - where="${__AF_untar289_v0__37_23}" + __AF_untar294_v0__37_23="${__AF_untar294_v0}"; + where="${__AF_untar294_v0__37_23}" my_status=$__AS fi env_var_test__87_v0 "_NIXIE_TESTING_SOURCES_DIR"; @@ -1092,9 +1155,9 @@ fi __AS=$?; __AF_env_var_get91_v0__42_28="${__AF_env_var_get91_v0}"; local srcdir="${__AF_env_var_get91_v0__42_28}" - __AMBER_VAL_56=$(mktemp -t -d nixie_${member}_XXXXXXXX); + __AMBER_VAL_57=$(mktemp -t -d nixie_${member}_XXXXXXXX); __AS=$?; - local tmpd="${__AMBER_VAL_56}" + local tmpd="${__AMBER_VAL_57}" file_exists__33_v0 "${srcdir}/${member}.tar.gz"; __AF_file_exists33_v0__45_12="$__AF_file_exists33_v0"; if [ "$__AF_file_exists33_v0__45_12" != 0 ]; then @@ -1107,24 +1170,24 @@ else fi fi if [ $(echo ${my_status} '!=' 0 | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - __AMBER_VAL_57=$(mktemp -t nixie_src_XXXXXXXX.tgz); + __AMBER_VAL_58=$(mktemp -t nixie_src_XXXXXXXX.tgz); __AS=$?; - local tmpf="${__AMBER_VAL_57}" - __AMBER_VAL_58=$(mktemp -t -d nixie_${member}_XXXXXXXX); + local tmpf="${__AMBER_VAL_58}" + __AMBER_VAL_59=$(mktemp -t -d nixie_${member}_XXXXXXXX); __AS=$?; - local tmpd="${__AMBER_VAL_58}" - cachix_url__312_v0 "${SOURCE_DERIVATION}" "${member}.tar.gz"; - __AF_cachix_url312_v0__58_30="${__AF_cachix_url312_v0}"; - file_download__233_v0 "${__AF_cachix_url312_v0__58_30}" "${tmpf}"; - __AF_file_download233_v0__58_16="$__AF_file_download233_v0"; - if [ $(echo '!' "$__AF_file_download233_v0__58_16" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - __AF_pull_source_file313_v0=''; + local tmpd="${__AMBER_VAL_59}" + cachix_url__319_v0 "${SOURCE_DERIVATION}" "${member}.tar.gz"; + __AF_cachix_url319_v0__58_30="${__AF_cachix_url319_v0}"; + file_download__237_v0 "${__AF_cachix_url319_v0__58_30}" "${tmpf}"; + __AF_file_download237_v0__58_16="$__AF_file_download237_v0"; + if [ $(echo '!' "$__AF_file_download237_v0__58_16" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then + __AF_pull_source_file320_v0=''; return 1 fi gzip -d -c ${tmpf} | tar -x -C ${tmpd}; __AS=$?; if [ $__AS != 0 ]; then -__AF_pull_source_file313_v0='' +__AF_pull_source_file320_v0='' return $__AS fi rm -f ${tmpf}; @@ -1137,18 +1200,18 @@ fi __AS=$? } __28_step_current=1 -pkg_exists__322_v0() { +pkg_exists__329_v0() { local package=$1 pkg-config ${package}; __AS=$?; if [ $__AS != 0 ]; then - __AF_pkg_exists322_v0=0; + __AF_pkg_exists329_v0=0; return 0 fi - __AF_pkg_exists322_v0=1; + __AF_pkg_exists329_v0=1; return 0 } -step_title__323_v0() { +step_title__330_v0() { local name=$1 env_var_get__91_v0 "step_total"; __AS=$?; @@ -1156,59 +1219,59 @@ step_title__323_v0() { local step_total="${__AF_env_var_get91_v0__26_28}" clear; __AS=$? - set_title__259_v0 "Building Nix: ${name} (${__28_step_current}/${step_total})"; - __AF_set_title259_v0__30_5="$__AF_set_title259_v0"; - echo "$__AF_set_title259_v0__30_5" > /dev/null 2>&1 + set_title__263_v0 "Building Nix: ${name} (${__28_step_current}/${step_total})"; + __AF_set_title263_v0__30_5="$__AF_set_title263_v0"; + echo "$__AF_set_title263_v0__30_5" > /dev/null 2>&1 __28_step_current=$(echo ${__28_step_current} '+' 1 | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') } -get_source_root__324_v0() { - get_repo_root__298_v0 ; - __AF_get_repo_root298_v0__38_21="${__AF_get_repo_root298_v0}"; - local repo_root="${__AF_get_repo_root298_v0__38_21}" - __AF_get_source_root324_v0="${repo_root}/.nixie/sources"; +get_source_root__331_v0() { + get_repo_root__303_v0 ; + __AF_get_repo_root303_v0__38_21="${__AF_get_repo_root303_v0}"; + local repo_root="${__AF_get_repo_root303_v0__38_21}" + __AF_get_source_root331_v0="${repo_root}/.nixie/sources"; return 0 } -make_headers__328_v0() { - __AMBER_VAL_59=$(grep ".*\.h:" ./Makefile | cut -f 1 -d :); +make_headers__335_v0() { + __AMBER_VAL_60=$(grep ".*\.h:" ./Makefile | cut -f 1 -d :); __AS=$?; - split_lines__4_v0 "${__AMBER_VAL_59}"; + split_lines__4_v0 "${__AMBER_VAL_60}"; __AF_split_lines4_v0__19_19=("${__AF_split_lines4_v0[@]}"); for header in "${__AF_split_lines4_v0__19_19[@]}"; do make ${header}; __AS=$?; if [ $__AS != 0 ]; then -__AF_make_headers328_v0='' +__AF_make_headers335_v0='' return $__AS fi done } -build_openssl_inner__329_v0() { - get_dll_ext__295_v0 ; - __AF_get_dll_ext295_v0__27_19="${__AF_get_dll_ext295_v0}"; - local dll_ext="${__AF_get_dll_ext295_v0__27_19}" - get_cache_root__297_v0 ; - __AF_get_cache_root297_v0__28_22="${__AF_get_cache_root297_v0}"; - local cache_root="${__AF_get_cache_root297_v0__28_22}" +build_openssl_inner__336_v0() { + get_dll_ext__300_v0 ; + __AF_get_dll_ext300_v0__27_19="${__AF_get_dll_ext300_v0}"; + local dll_ext="${__AF_get_dll_ext300_v0__27_19}" + get_cache_root__302_v0 ; + __AF_get_cache_root302_v0__28_22="${__AF_get_cache_root302_v0}"; + local cache_root="${__AF_get_cache_root302_v0__28_22}" chmod +x ./config; __AS=$? ./config; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_openssl_inner329_v0='' +__AF_build_openssl_inner336_v0='' return $__AS fi - make_headers__328_v0 ; + make_headers__335_v0 ; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_openssl_inner329_v0='' +__AF_build_openssl_inner336_v0='' return $__AS fi; - __AF_make_headers328_v0__33_5="$__AF_make_headers328_v0"; - echo "$__AF_make_headers328_v0__33_5" > /dev/null 2>&1 + __AF_make_headers335_v0__33_5="$__AF_make_headers335_v0"; + echo "$__AF_make_headers335_v0__33_5" > /dev/null 2>&1 make libcrypto.${dll_ext} libcrypto.pc; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_openssl_inner329_v0='' +__AF_build_openssl_inner336_v0='' return $__AS fi cp ./libcrypto.* ${cache_root}/nix-deps/lib/; @@ -1218,20 +1281,20 @@ fi cp -r ./include ${cache_root}/nix-deps/; __AS=$? } -build_openssl__330_v0() { - get_source_root__324_v0 ; - __AF_get_source_root324_v0__51_23="${__AF_get_source_root324_v0}"; - local source_root="${__AF_get_source_root324_v0__51_23}" - get_cache_root__297_v0 ; - __AF_get_cache_root297_v0__52_22="${__AF_get_cache_root297_v0}"; - local cache_root="${__AF_get_cache_root297_v0__52_22}" - step_title__323_v0 "libcrypto"; - __AF_step_title323_v0__54_5="$__AF_step_title323_v0"; - echo "$__AF_step_title323_v0__54_5" > /dev/null 2>&1 - pkg_exists__322_v0 "libcrypto"; - __AF_pkg_exists322_v0__56_8="$__AF_pkg_exists322_v0"; - if [ "$__AF_pkg_exists322_v0__56_8" != 0 ]; then - __AF_build_openssl330_v0=0; +build_openssl__337_v0() { + get_source_root__331_v0 ; + __AF_get_source_root331_v0__51_23="${__AF_get_source_root331_v0}"; + local source_root="${__AF_get_source_root331_v0__51_23}" + get_cache_root__302_v0 ; + __AF_get_cache_root302_v0__52_22="${__AF_get_cache_root302_v0}"; + local cache_root="${__AF_get_cache_root302_v0__52_22}" + step_title__330_v0 "libcrypto"; + __AF_step_title330_v0__54_5="$__AF_step_title330_v0"; + echo "$__AF_step_title330_v0__54_5" > /dev/null 2>&1 + pkg_exists__329_v0 "libcrypto"; + __AF_pkg_exists329_v0__56_8="$__AF_pkg_exists329_v0"; + if [ "$__AF_pkg_exists329_v0__56_8" != 0 ]; then + __AF_build_openssl337_v0=0; return 0 fi env_var_test__87_v0 "OPENSSL_LIBS"; @@ -1239,140 +1302,140 @@ fi env_var_test__87_v0 "OPENSSL_CFLAGS"; __AF_env_var_test87_v0__58_41="$__AF_env_var_test87_v0"; if [ $(echo "$__AF_env_var_test87_v0__58_8" '&&' "$__AF_env_var_test87_v0__58_41" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - __AF_build_openssl330_v0=0; + __AF_build_openssl337_v0=0; return 0 fi - pull_source_file__313_v0 "openssl" "${source_root}/openssl"; + pull_source_file__320_v0 "openssl" "${source_root}/openssl"; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_openssl330_v0='' +__AF_build_openssl337_v0='' return $__AS fi; - __AF_pull_source_file313_v0__61_5="$__AF_pull_source_file313_v0"; - echo "$__AF_pull_source_file313_v0__61_5" > /dev/null 2>&1 - (cd ${source_root}/openssl && build_openssl_inner__329_v0); + __AF_pull_source_file320_v0__61_5="$__AF_pull_source_file320_v0"; + echo "$__AF_pull_source_file320_v0__61_5" > /dev/null 2>&1 + (cd ${source_root}/openssl && build_openssl_inner__336_v0); __AS=$?; if [ $__AS != 0 ]; then -__AF_build_openssl330_v0='' +__AF_build_openssl337_v0='' return $__AS fi } -macos_build_post__339_v0() { +macos_build_post__346_v0() { cc -shared -o liblowdown.1.dylib *.o; __AS=$?; if [ $__AS != 0 ]; then -__AF_macos_build_post339_v0='' +__AF_macos_build_post346_v0='' return $__AS fi } -build_lowdown_inner__340_v0() { - get_cache_root__297_v0 ; - __AF_get_cache_root297_v0__21_22="${__AF_get_cache_root297_v0}"; - local cache_root="${__AF_get_cache_root297_v0__21_22}" +build_lowdown_inner__347_v0() { + get_cache_root__302_v0 ; + __AF_get_cache_root302_v0__21_22="${__AF_get_cache_root302_v0}"; + local cache_root="${__AF_get_cache_root302_v0__21_22}" ./configure PREFIX=${cache_root}/nix-deps; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_lowdown_inner340_v0='' +__AF_build_lowdown_inner347_v0='' return $__AS fi make; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_lowdown_inner340_v0='' +__AF_build_lowdown_inner347_v0='' return $__AS fi - get_osname__292_v0 ; - __AF_get_osname292_v0__26_8="${__AF_get_osname292_v0}"; - if [ $([ "_${__AF_get_osname292_v0__26_8}" != "_Darwin" ]; echo $?) != 0 ]; then - macos_build_post__339_v0 ; + get_osname__297_v0 ; + __AF_get_osname297_v0__26_8="${__AF_get_osname297_v0}"; + if [ $([ "_${__AF_get_osname297_v0__26_8}" != "_Darwin" ]; echo $?) != 0 ]; then + macos_build_post__346_v0 ; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_lowdown_inner340_v0='' +__AF_build_lowdown_inner347_v0='' return $__AS fi; - __AF_macos_build_post339_v0__27_9="$__AF_macos_build_post339_v0"; - echo "$__AF_macos_build_post339_v0__27_9" > /dev/null 2>&1 + __AF_macos_build_post346_v0__27_9="$__AF_macos_build_post346_v0"; + echo "$__AF_macos_build_post346_v0__27_9" > /dev/null 2>&1 fi make install_shared; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_lowdown_inner340_v0='' +__AF_build_lowdown_inner347_v0='' return $__AS fi } -build_lowdown__341_v0() { - get_source_root__324_v0 ; - __AF_get_source_root324_v0__36_23="${__AF_get_source_root324_v0}"; - local source_root="${__AF_get_source_root324_v0__36_23}" - get_cache_root__297_v0 ; - __AF_get_cache_root297_v0__37_22="${__AF_get_cache_root297_v0}"; - local cache_root="${__AF_get_cache_root297_v0__37_22}" - step_title__323_v0 "lowdown"; - __AF_step_title323_v0__39_5="$__AF_step_title323_v0"; - echo "$__AF_step_title323_v0__39_5" > /dev/null 2>&1 - pkg_exists__322_v0 "lowdown"; - __AF_pkg_exists322_v0__41_8="$__AF_pkg_exists322_v0"; - if [ "$__AF_pkg_exists322_v0__41_8" != 0 ]; then - __AF_build_lowdown341_v0=0; +build_lowdown__348_v0() { + get_source_root__331_v0 ; + __AF_get_source_root331_v0__36_23="${__AF_get_source_root331_v0}"; + local source_root="${__AF_get_source_root331_v0__36_23}" + get_cache_root__302_v0 ; + __AF_get_cache_root302_v0__37_22="${__AF_get_cache_root302_v0}"; + local cache_root="${__AF_get_cache_root302_v0__37_22}" + step_title__330_v0 "lowdown"; + __AF_step_title330_v0__39_5="$__AF_step_title330_v0"; + echo "$__AF_step_title330_v0__39_5" > /dev/null 2>&1 + pkg_exists__329_v0 "lowdown"; + __AF_pkg_exists329_v0__41_8="$__AF_pkg_exists329_v0"; + if [ "$__AF_pkg_exists329_v0__41_8" != 0 ]; then + __AF_build_lowdown348_v0=0; return 0 fi - pull_source_file__313_v0 "lowdown" "${source_root}/lowdown"; + pull_source_file__320_v0 "lowdown" "${source_root}/lowdown"; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_lowdown341_v0='' +__AF_build_lowdown348_v0='' return $__AS fi; - __AF_pull_source_file313_v0__44_5="$__AF_pull_source_file313_v0"; - echo "$__AF_pull_source_file313_v0__44_5" > /dev/null 2>&1 - (cd ${source_root}/lowdown && build_lowdown_inner__340_v0); + __AF_pull_source_file320_v0__44_5="$__AF_pull_source_file320_v0"; + echo "$__AF_pull_source_file320_v0__44_5" > /dev/null 2>&1 + (cd ${source_root}/lowdown && build_lowdown_inner__347_v0); __AS=$?; if [ $__AS != 0 ]; then -__AF_build_lowdown341_v0='' +__AF_build_lowdown348_v0='' return $__AS fi } -build_nlohmann_json__350_v0() { - get_source_root__324_v0 ; - __AF_get_source_root324_v0__16_23="${__AF_get_source_root324_v0}"; - local source_root="${__AF_get_source_root324_v0__16_23}" - get_cache_root__297_v0 ; - __AF_get_cache_root297_v0__17_22="${__AF_get_cache_root297_v0}"; - local cache_root="${__AF_get_cache_root297_v0__17_22}" - step_title__323_v0 "nlohmann_json"; - __AF_step_title323_v0__19_5="$__AF_step_title323_v0"; - echo "$__AF_step_title323_v0__19_5" > /dev/null 2>&1 - pkg_exists__322_v0 "nlohmann_json"; - __AF_pkg_exists322_v0__21_8="$__AF_pkg_exists322_v0"; - if [ "$__AF_pkg_exists322_v0__21_8" != 0 ]; then - __AF_build_nlohmann_json350_v0=0; +build_nlohmann_json__357_v0() { + get_source_root__331_v0 ; + __AF_get_source_root331_v0__16_23="${__AF_get_source_root331_v0}"; + local source_root="${__AF_get_source_root331_v0__16_23}" + get_cache_root__302_v0 ; + __AF_get_cache_root302_v0__17_22="${__AF_get_cache_root302_v0}"; + local cache_root="${__AF_get_cache_root302_v0__17_22}" + step_title__330_v0 "nlohmann_json"; + __AF_step_title330_v0__19_5="$__AF_step_title330_v0"; + echo "$__AF_step_title330_v0__19_5" > /dev/null 2>&1 + pkg_exists__329_v0 "nlohmann_json"; + __AF_pkg_exists329_v0__21_8="$__AF_pkg_exists329_v0"; + if [ "$__AF_pkg_exists329_v0__21_8" != 0 ]; then + __AF_build_nlohmann_json357_v0=0; return 0 fi - pull_source_file__313_v0 "nlohmann_json" "${source_root}/nlohmann_json"; + pull_source_file__320_v0 "nlohmann_json" "${source_root}/nlohmann_json"; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_nlohmann_json350_v0='' +__AF_build_nlohmann_json357_v0='' return $__AS fi; - __AF_pull_source_file313_v0__24_5="$__AF_pull_source_file313_v0"; - echo "$__AF_pull_source_file313_v0__24_5" > /dev/null 2>&1 - __AMBER_VAL_60=$(grep "^version:" ${source_root}/nlohmann_json/wsjcpp.yml | cut -d '"' -f 2 | cut -d 'v' -f 2); + __AF_pull_source_file320_v0__24_5="$__AF_pull_source_file320_v0"; + echo "$__AF_pull_source_file320_v0__24_5" > /dev/null 2>&1 + __AMBER_VAL_61=$(grep "^version:" ${source_root}/nlohmann_json/wsjcpp.yml | cut -d '"' -f 2 | cut -d 'v' -f 2); __AS=$?; - local version="${__AMBER_VAL_60}" + local version="${__AMBER_VAL_61}" file_write__35_v0 "${cache_root}/nix-deps/lib/pkgconfig/nlohmann_json.pc" "Name: nlohmann_json Version: ${version} Description: JSON for Modern C++ Cflags: -I${source_root}/nlohmann_json/include"; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_nlohmann_json350_v0='' +__AF_build_nlohmann_json357_v0='' return $__AS fi; __AF_file_write35_v0__28_5="${__AF_file_write35_v0}"; echo "${__AF_file_write35_v0__28_5}" > /dev/null 2>&1 } -__AMBER_ARRAY_61=("predef" "chrono" "container" "context" "coroutine" "system" "thread"); -__29_modules=("${__AMBER_ARRAY_61[@]}") -find_boost_libs__359_v0() { +__AMBER_ARRAY_62=("predef" "chrono" "container" "context" "coroutine" "system" "thread"); +__29_modules=("${__AMBER_ARRAY_62[@]}") +find_boost_libs__366_v0() { local libs=("${!1}") for lib in "${libs[@]}"; do local libname="libboost_${lib}*" @@ -1381,7 +1444,7 @@ find_boost_libs__359_v0() { file_exists__33_v0 "/usr/local/lib/${libname}"; __AF_file_exists33_v0__24_20="$__AF_file_exists33_v0"; if [ $(echo '!' $(echo "$__AF_file_exists33_v0__23_20" '||' "$__AF_file_exists33_v0__24_20" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - __AF_find_boost_libs359_v0=0; + __AF_find_boost_libs366_v0=0; return 0 fi dir_exists__32_v0 "/usr/include/boost/${lib}"; @@ -1389,60 +1452,60 @@ fi dir_exists__32_v0 "/usr/local/include/boost/${lib}"; __AF_dir_exists32_v0__27_20="$__AF_dir_exists32_v0"; if [ $(echo '!' $(echo "$__AF_dir_exists32_v0__26_20" '||' "$__AF_dir_exists32_v0__27_20" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - __AF_find_boost_libs359_v0=0; + __AF_find_boost_libs366_v0=0; return 0 fi done - __AF_find_boost_libs359_v0=1; + __AF_find_boost_libs366_v0=1; return 0 } -build_boost_inner__360_v0() { - __AMBER_ARRAY_62=("variant=release" "link=static" "--stagedir=."); - local args=("${__AMBER_ARRAY_62[@]}") +build_boost_inner__367_v0() { + __AMBER_ARRAY_63=("variant=release" "link=static" "--stagedir=."); + local args=("${__AMBER_ARRAY_63[@]}") for mod in "${__29_modules[@]}"; do - __AMBER_ARRAY_63=("--with-${mod}"); - args+=("${__AMBER_ARRAY_63[@]}") + __AMBER_ARRAY_64=("--with-${mod}"); + args+=("${__AMBER_ARRAY_64[@]}") done ./bootstrap.sh; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_boost_inner360_v0='' +__AF_build_boost_inner367_v0='' return $__AS fi ./b2 "${args[@]}"; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_boost_inner360_v0='' +__AF_build_boost_inner367_v0='' return $__AS fi } -build_boost__361_v0() { - get_source_root__324_v0 ; - __AF_get_source_root324_v0__52_23="${__AF_get_source_root324_v0}"; - local source_root="${__AF_get_source_root324_v0__52_23}" - step_title__323_v0 "boost"; - __AF_step_title323_v0__54_5="$__AF_step_title323_v0"; - echo "$__AF_step_title323_v0__54_5" > /dev/null 2>&1 - __AMBER_ARRAY_64=("atomic"); - __AMBER_ARRAY_ADD_65=("${__AMBER_ARRAY_64[@]}" "${__29_modules[@]}"); - find_boost_libs__359_v0 __AMBER_ARRAY_ADD_65[@]; - __AF_find_boost_libs359_v0__56_8="$__AF_find_boost_libs359_v0"; - if [ "$__AF_find_boost_libs359_v0__56_8" != 0 ]; then - __AF_build_boost361_v0=0; +build_boost__368_v0() { + get_source_root__331_v0 ; + __AF_get_source_root331_v0__52_23="${__AF_get_source_root331_v0}"; + local source_root="${__AF_get_source_root331_v0__52_23}" + step_title__330_v0 "boost"; + __AF_step_title330_v0__54_5="$__AF_step_title330_v0"; + echo "$__AF_step_title330_v0__54_5" > /dev/null 2>&1 + __AMBER_ARRAY_65=("atomic"); + __AMBER_ARRAY_ADD_66=("${__AMBER_ARRAY_65[@]}" "${__29_modules[@]}"); + find_boost_libs__366_v0 __AMBER_ARRAY_ADD_66[@]; + __AF_find_boost_libs366_v0__56_8="$__AF_find_boost_libs366_v0"; + if [ "$__AF_find_boost_libs366_v0__56_8" != 0 ]; then + __AF_build_boost368_v0=0; return 0 fi - pull_source_file__313_v0 "boost" "${source_root}/boost"; + pull_source_file__320_v0 "boost" "${source_root}/boost"; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_boost361_v0='' +__AF_build_boost368_v0='' return $__AS fi; - __AF_pull_source_file313_v0__59_5="$__AF_pull_source_file313_v0"; - echo "$__AF_pull_source_file313_v0__59_5" > /dev/null 2>&1 - (cd ${source_root}/boost && build_boost_inner__360_v0); + __AF_pull_source_file320_v0__59_5="$__AF_pull_source_file320_v0"; + echo "$__AF_pull_source_file320_v0__59_5" > /dev/null 2>&1 + (cd ${source_root}/boost && build_boost_inner__367_v0); __AS=$?; if [ $__AS != 0 ]; then -__AF_build_boost361_v0='' +__AF_build_boost368_v0='' return $__AS fi env_var_set__90_v0 "BOOST_ROOT" "${source_root}/boost"; @@ -1452,87 +1515,87 @@ fi export BOOST_ROOT; __AS=$? } -build_autoconf_dep__369_v0() { +build_autoconf_dep__376_v0() { local lib_name=$1 local inc_prefix=$2 - get_source_root__324_v0 ; - __AF_get_source_root324_v0__19_23="${__AF_get_source_root324_v0}"; - local source_root="${__AF_get_source_root324_v0__19_23}" - get_cache_root__297_v0 ; - __AF_get_cache_root297_v0__20_22="${__AF_get_cache_root297_v0}"; - local cache_root="${__AF_get_cache_root297_v0__20_22}" + get_source_root__331_v0 ; + __AF_get_source_root331_v0__19_23="${__AF_get_source_root331_v0}"; + local source_root="${__AF_get_source_root331_v0__19_23}" + get_cache_root__302_v0 ; + __AF_get_cache_root302_v0__20_22="${__AF_get_cache_root302_v0}"; + local cache_root="${__AF_get_cache_root302_v0__20_22}" local my_source="${source_root}/${lib_name}" - step_title__323_v0 "${lib_name}"; - __AF_step_title323_v0__24_5="$__AF_step_title323_v0"; - echo "$__AF_step_title323_v0__24_5" > /dev/null 2>&1 - pkg_exists__322_v0 "${lib_name}"; - __AF_pkg_exists322_v0__26_8="$__AF_pkg_exists322_v0"; - if [ "$__AF_pkg_exists322_v0__26_8" != 0 ]; then - __AF_build_autoconf_dep369_v0=''; + step_title__330_v0 "${lib_name}"; + __AF_step_title330_v0__24_5="$__AF_step_title330_v0"; + echo "$__AF_step_title330_v0__24_5" > /dev/null 2>&1 + pkg_exists__329_v0 "${lib_name}"; + __AF_pkg_exists329_v0__26_8="$__AF_pkg_exists329_v0"; + if [ "$__AF_pkg_exists329_v0__26_8" != 0 ]; then + __AF_build_autoconf_dep376_v0=''; return 0 fi - pull_source_file__313_v0 "${lib_name}" "${my_source}"; + pull_source_file__320_v0 "${lib_name}" "${my_source}"; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_autoconf_dep369_v0='' +__AF_build_autoconf_dep376_v0='' return $__AS fi; - __AF_pull_source_file313_v0__29_5="$__AF_pull_source_file313_v0"; - echo "$__AF_pull_source_file313_v0__29_5" > /dev/null 2>&1 + __AF_pull_source_file320_v0__29_5="$__AF_pull_source_file320_v0"; + echo "$__AF_pull_source_file320_v0__29_5" > /dev/null 2>&1 ( unset C_INCLUDE_PATH CPLUS_INCLUDE_PATH && cd ${my_source} && ./configure --prefix=${cache_root}/nix-deps && make && make install ); __AS=$?; if [ $__AS != 0 ]; then -__AF_build_autoconf_dep369_v0='' +__AF_build_autoconf_dep376_v0='' return $__AS fi } -build_nix_inner__379_v0() { - get_source_root__324_v0 ; - __AF_get_source_root324_v0__16_23="${__AF_get_source_root324_v0}"; - local source_root="${__AF_get_source_root324_v0__16_23}" +build_nix_inner__386_v0() { + get_source_root__331_v0 ; + __AF_get_source_root331_v0__16_23="${__AF_get_source_root331_v0}"; + local source_root="${__AF_get_source_root331_v0__16_23}" local venv="${source_root}/nix/venv" mkdir build && cd build; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_nix_inner379_v0='' +__AF_build_nix_inner386_v0='' return $__AS fi ${venv}/bin/meson setup -Dlibstore:seccomp-sandboxing=disabled -Dlibcmd:readline-flavor=editline -Dlibexpr:gc=disabled -Dlibutil:cpuid=disabled -Ddoc-gen=false -Dunit-tests=false -Dbindings=false ..; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_nix_inner379_v0='' +__AF_build_nix_inner386_v0='' return $__AS fi ${venv}/bin/ninja; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_nix_inner379_v0='' +__AF_build_nix_inner386_v0='' return $__AS fi } -build_nix__380_v0() { - get_source_root__324_v0 ; - __AF_get_source_root324_v0__39_23="${__AF_get_source_root324_v0}"; - local source_root="${__AF_get_source_root324_v0__39_23}" - get_cache_root__297_v0 ; - __AF_get_cache_root297_v0__40_22="${__AF_get_cache_root297_v0}"; - local cache_root="${__AF_get_cache_root297_v0__40_22}" +build_nix__387_v0() { + get_source_root__331_v0 ; + __AF_get_source_root331_v0__39_23="${__AF_get_source_root331_v0}"; + local source_root="${__AF_get_source_root331_v0__39_23}" + get_cache_root__302_v0 ; + __AF_get_cache_root302_v0__40_22="${__AF_get_cache_root302_v0}"; + local cache_root="${__AF_get_cache_root302_v0__40_22}" local venv="${source_root}/nix/venv" - step_title__323_v0 "nix"; - __AF_step_title323_v0__44_5="$__AF_step_title323_v0"; - echo "$__AF_step_title323_v0__44_5" > /dev/null 2>&1 - pull_source_file__313_v0 "nix" "${source_root}/nix"; + step_title__330_v0 "nix"; + __AF_step_title330_v0__44_5="$__AF_step_title330_v0"; + echo "$__AF_step_title330_v0__44_5" > /dev/null 2>&1 + pull_source_file__320_v0 "nix" "${source_root}/nix"; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_nix380_v0='' +__AF_build_nix387_v0='' return $__AS fi; - __AF_pull_source_file313_v0__46_5="$__AF_pull_source_file313_v0"; - echo "$__AF_pull_source_file313_v0__46_5" > /dev/null 2>&1 + __AF_pull_source_file320_v0__46_5="$__AF_pull_source_file320_v0"; + echo "$__AF_pull_source_file320_v0__46_5" > /dev/null 2>&1 python3 -m venv --system-site-packages "${venv}"; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_nix380_v0='' +__AF_build_nix387_v0='' return $__AS fi export LIBRARY_PATH=${cache_root}/nix-deps/lib:$LIBRARY_PATH; @@ -1542,22 +1605,22 @@ fi ${venv}/bin/pip install meson ninja; __AS=$?; if [ $__AS != 0 ]; then -__AF_build_nix380_v0='' +__AF_build_nix387_v0='' return $__AS fi - (cd ${source_root}/nix && build_nix_inner__379_v0); + (cd ${source_root}/nix && build_nix_inner__386_v0); __AS=$?; if [ $__AS != 0 ]; then -__AF_build_nix380_v0='' +__AF_build_nix387_v0='' return $__AS fi mv "${source_root}/nix/src/nix/nix" "${cache_root}/nix-static" __AS=$? } -darwin_export_sdk__382_v0() { - __AMBER_VAL_66=$(xcrun --show-sdk-path); +darwin_export_sdk__389_v0() { + __AMBER_VAL_67=$(xcrun --show-sdk-path); __AS=$?; - local sdk_path="${__AMBER_VAL_66}" + local sdk_path="${__AMBER_VAL_67}" dir_exists__32_v0 "${sdk_path}"; __AF_dir_exists32_v0__30_12="$__AF_dir_exists32_v0"; if [ $(echo '!' "$__AF_dir_exists32_v0__30_12" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then @@ -1594,12 +1657,12 @@ fi export LIBCURL_LIBS LIBCURL_CFLAGS LIBARCHIVE_LIBS LIBARCHIVE_CFLAGS OPENSSL_LIBS OPENSSL_CFLAGS; __AS=$? } -try_build_nix__383_v0() { - get_cache_root__159_v0 ; - __AF_get_cache_root159_v0__55_22="${__AF_get_cache_root159_v0}"; - local cache_root="${__AF_get_cache_root159_v0__55_22}" - __AMBER_ARRAY_67=("cc" "c++" "pkg-config" "make" "flex" "bison" "perl"); - check_deps__144_v0 __AMBER_ARRAY_67[@]; +try_build_nix__390_v0() { + get_cache_root__160_v0 ; + __AF_get_cache_root160_v0__55_22="${__AF_get_cache_root160_v0}"; + local cache_root="${__AF_get_cache_root160_v0__55_22}" + __AMBER_ARRAY_68=("cc" "c++" "pkg-config" "make" "flex" "bison" "perl"); + check_deps__144_v0 __AMBER_ARRAY_68[@]; __AS=$?; if [ $__AS != 0 ]; then bail__140_v0 "Missing required dependencies to build from source." 0; @@ -1608,124 +1671,124 @@ if [ $__AS != 0 ]; then fi; __AF_check_deps144_v0__57_5="$__AF_check_deps144_v0"; echo "$__AF_check_deps144_v0__57_5" > /dev/null 2>&1 - get_osname__154_v0 ; - __AF_get_osname154_v0__60_8="${__AF_get_osname154_v0}"; - if [ $([ "_${__AF_get_osname154_v0__60_8}" != "_Darwin" ]; echo $?) != 0 ]; then - darwin_export_sdk__382_v0 ; - __AF_darwin_export_sdk382_v0__61_9="$__AF_darwin_export_sdk382_v0"; - echo "$__AF_darwin_export_sdk382_v0__61_9" > /dev/null 2>&1 + get_osname__155_v0 ; + __AF_get_osname155_v0__60_8="${__AF_get_osname155_v0}"; + if [ $([ "_${__AF_get_osname155_v0__60_8}" != "_Darwin" ]; echo $?) != 0 ]; then + darwin_export_sdk__389_v0 ; + __AF_darwin_export_sdk389_v0__61_9="$__AF_darwin_export_sdk389_v0"; + echo "$__AF_darwin_export_sdk389_v0__61_9" > /dev/null 2>&1 fi env_var_set__90_v0 "step_total" "9"; __AS=$?; __AF_env_var_set90_v0__63_11="$__AF_env_var_set90_v0"; echo "$__AF_env_var_set90_v0__63_11" > /dev/null 2>&1 - get_source_root__302_v0 ; - __AF_get_source_root302_v0__65_16="${__AF_get_source_root302_v0}"; - dir_create__38_v0 "${__AF_get_source_root302_v0__65_16}"; + get_source_root__309_v0 ; + __AF_get_source_root309_v0__65_16="${__AF_get_source_root309_v0}"; + dir_create__38_v0 "${__AF_get_source_root309_v0__65_16}"; __AF_dir_create38_v0__65_5="$__AF_dir_create38_v0"; echo "$__AF_dir_create38_v0__65_5" > /dev/null 2>&1 dir_create__38_v0 "${cache_root}/nix-deps/lib/pkgconfig"; __AF_dir_create38_v0__66_5="$__AF_dir_create38_v0"; echo "$__AF_dir_create38_v0__66_5" > /dev/null 2>&1 - build_openssl__330_v0 ; + build_openssl__337_v0 ; __AS=$?; if [ $__AS != 0 ]; then -__AF_try_build_nix383_v0='' +__AF_try_build_nix390_v0='' return $__AS fi; - __AF_build_openssl330_v0__68_5="$__AF_build_openssl330_v0"; - echo "$__AF_build_openssl330_v0__68_5" > /dev/null 2>&1 - build_boost__361_v0 ; + __AF_build_openssl337_v0__68_5="$__AF_build_openssl337_v0"; + echo "$__AF_build_openssl337_v0__68_5" > /dev/null 2>&1 + build_boost__368_v0 ; __AS=$?; if [ $__AS != 0 ]; then -__AF_try_build_nix383_v0='' +__AF_try_build_nix390_v0='' return $__AS fi; - __AF_build_boost361_v0__69_5="$__AF_build_boost361_v0"; - echo "$__AF_build_boost361_v0__69_5" > /dev/null 2>&1 - build_nlohmann_json__350_v0 ; + __AF_build_boost368_v0__69_5="$__AF_build_boost368_v0"; + echo "$__AF_build_boost368_v0__69_5" > /dev/null 2>&1 + build_nlohmann_json__357_v0 ; __AS=$?; if [ $__AS != 0 ]; then -__AF_try_build_nix383_v0='' +__AF_try_build_nix390_v0='' return $__AS fi; - __AF_build_nlohmann_json350_v0__70_5="$__AF_build_nlohmann_json350_v0"; - echo "$__AF_build_nlohmann_json350_v0__70_5" > /dev/null 2>&1 - build_lowdown__341_v0 ; + __AF_build_nlohmann_json357_v0__70_5="$__AF_build_nlohmann_json357_v0"; + echo "$__AF_build_nlohmann_json357_v0__70_5" > /dev/null 2>&1 + build_lowdown__348_v0 ; __AS=$?; if [ $__AS != 0 ]; then -__AF_try_build_nix383_v0='' +__AF_try_build_nix390_v0='' return $__AS fi; - __AF_build_lowdown341_v0__71_5="$__AF_build_lowdown341_v0"; - echo "$__AF_build_lowdown341_v0__71_5" > /dev/null 2>&1 - build_autoconf_dep__369_v0 "libbrotlicommon" "c/include"; + __AF_build_lowdown348_v0__71_5="$__AF_build_lowdown348_v0"; + echo "$__AF_build_lowdown348_v0__71_5" > /dev/null 2>&1 + build_autoconf_dep__376_v0 "libbrotlicommon" "c/include"; __AS=$?; if [ $__AS != 0 ]; then -__AF_try_build_nix383_v0='' +__AF_try_build_nix390_v0='' return $__AS fi; - __AF_build_autoconf_dep369_v0__73_5="$__AF_build_autoconf_dep369_v0"; - echo "$__AF_build_autoconf_dep369_v0__73_5" > /dev/null 2>&1 - build_autoconf_dep__369_v0 "libsodium" "src/libsodium/include"; + __AF_build_autoconf_dep376_v0__73_5="$__AF_build_autoconf_dep376_v0"; + echo "$__AF_build_autoconf_dep376_v0__73_5" > /dev/null 2>&1 + build_autoconf_dep__376_v0 "libsodium" "src/libsodium/include"; __AS=$?; if [ $__AS != 0 ]; then -__AF_try_build_nix383_v0='' +__AF_try_build_nix390_v0='' return $__AS fi; - __AF_build_autoconf_dep369_v0__74_5="$__AF_build_autoconf_dep369_v0"; - echo "$__AF_build_autoconf_dep369_v0__74_5" > /dev/null 2>&1 - build_autoconf_dep__369_v0 "libeditline" "include"; + __AF_build_autoconf_dep376_v0__74_5="$__AF_build_autoconf_dep376_v0"; + echo "$__AF_build_autoconf_dep376_v0__74_5" > /dev/null 2>&1 + build_autoconf_dep__376_v0 "libeditline" "include"; __AS=$?; if [ $__AS != 0 ]; then -__AF_try_build_nix383_v0='' +__AF_try_build_nix390_v0='' return $__AS fi; - __AF_build_autoconf_dep369_v0__75_5="$__AF_build_autoconf_dep369_v0"; - echo "$__AF_build_autoconf_dep369_v0__75_5" > /dev/null 2>&1 - build_autoconf_dep__369_v0 "libarchive" "libarchive"; + __AF_build_autoconf_dep376_v0__75_5="$__AF_build_autoconf_dep376_v0"; + echo "$__AF_build_autoconf_dep376_v0__75_5" > /dev/null 2>&1 + build_autoconf_dep__376_v0 "libarchive" "libarchive"; __AS=$?; if [ $__AS != 0 ]; then -__AF_try_build_nix383_v0='' +__AF_try_build_nix390_v0='' return $__AS fi; - __AF_build_autoconf_dep369_v0__76_5="$__AF_build_autoconf_dep369_v0"; - echo "$__AF_build_autoconf_dep369_v0__76_5" > /dev/null 2>&1 - build_nix__380_v0 ; + __AF_build_autoconf_dep376_v0__76_5="$__AF_build_autoconf_dep376_v0"; + echo "$__AF_build_autoconf_dep376_v0__76_5" > /dev/null 2>&1 + build_nix__387_v0 ; __AS=$?; if [ $__AS != 0 ]; then -__AF_try_build_nix383_v0='' +__AF_try_build_nix390_v0='' return $__AS fi; - __AF_build_nix380_v0__77_5="$__AF_build_nix380_v0"; - echo "$__AF_build_nix380_v0__77_5" > /dev/null 2>&1 + __AF_build_nix387_v0__77_5="$__AF_build_nix387_v0"; + echo "$__AF_build_nix387_v0__77_5" > /dev/null 2>&1 } -is_nix_installed__385_v0() { +is_nix_installed__392_v0() { env_var_test__87_v0 "nosystem"; __AF_env_var_test87_v0__24_8="$__AF_env_var_test87_v0"; if [ "$__AF_env_var_test87_v0__24_8" != 0 ]; then - __AF_is_nix_installed385_v0=0; + __AF_is_nix_installed392_v0=0; return 0 fi dir_exists__32_v0 "/nix/store"; __AF_dir_exists32_v0__29_8="$__AF_dir_exists32_v0"; if [ "$__AF_dir_exists32_v0__29_8" != 0 ]; then - __AF_is_nix_installed385_v0=1; + __AF_is_nix_installed392_v0=1; return 0 fi - __AF_is_nix_installed385_v0=0; + __AF_is_nix_installed392_v0=0; return 0 } -get_nix__386_v0() { - get_cache_root__159_v0 ; - __AF_get_cache_root159_v0__44_22="${__AF_get_cache_root159_v0}"; - local cache_root="${__AF_get_cache_root159_v0__44_22}" - get_osname__154_v0 ; - __AF_get_osname154_v0__45_18="${__AF_get_osname154_v0}"; - local osname="${__AF_get_osname154_v0__45_18}" - get_system__156_v0 ; - __AF_get_system156_v0__46_18="${__AF_get_system156_v0}"; - local system="${__AF_get_system156_v0__46_18}" +get_nix__393_v0() { + get_cache_root__160_v0 ; + __AF_get_cache_root160_v0__44_22="${__AF_get_cache_root160_v0}"; + local cache_root="${__AF_get_cache_root160_v0__44_22}" + get_osname__155_v0 ; + __AF_get_osname155_v0__45_18="${__AF_get_osname155_v0}"; + local osname="${__AF_get_osname155_v0__45_18}" + get_system__157_v0 ; + __AF_get_system157_v0__46_18="${__AF_get_system157_v0}"; + local system="${__AF_get_system157_v0__46_18}" local nix_path="${cache_root}/nix-static" local fakedir_path="${cache_root}/nix-deps/lib/libfakedir.dylib" enter_alt_buffer__134_v0 ; @@ -1742,27 +1805,27 @@ get_nix__386_v0() { dir_create__38_v0 "${cache_root}/nix-deps/lib"; __AF_dir_create38_v0__59_9="$__AF_dir_create38_v0"; echo "$__AF_dir_create38_v0__59_9" > /dev/null 2>&1 - pull_binary__241_v0 "libfakedir.dylib" "${fakedir_path}"; + pull_binary__245_v0 "libfakedir.dylib" "${fakedir_path}"; __AS=$?; if [ $__AS != 0 ]; then teardown__136_v0 1; __AF_teardown136_v0__61_13="$__AF_teardown136_v0"; echo "$__AF_teardown136_v0__61_13" > /dev/null 2>&1 - __AF_get_nix386_v0=''; + __AF_get_nix393_v0=''; return 1 fi; - __AF_pull_binary241_v0__60_9="$__AF_pull_binary241_v0"; - echo "$__AF_pull_binary241_v0__60_9" > /dev/null 2>&1 + __AF_pull_binary245_v0__60_9="$__AF_pull_binary245_v0"; + echo "$__AF_pull_binary245_v0__60_9" > /dev/null 2>&1 fi get_self__141_v0 ; __AF_get_self141_v0__67_62="${__AF_get_self141_v0}"; exists_newer__139_v0 "${fakedir_path}" "${__AF_get_self141_v0__67_62}"; __AF_exists_newer139_v0__67_35="$__AF_exists_newer139_v0"; if [ $(echo $([ "_${osname}" != "_Darwin" ]; echo $?) '&&' $(echo '!' "$__AF_exists_newer139_v0__67_35" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - pull_binary__241_v0 "libfakedir.dylib" "${fakedir_path}"; + pull_binary__245_v0 "libfakedir.dylib" "${fakedir_path}"; __AS=$?; - __AF_pull_binary241_v0__68_15="$__AF_pull_binary241_v0"; - echo "$__AF_pull_binary241_v0__68_15" > /dev/null 2>&1 + __AF_pull_binary245_v0__68_15="$__AF_pull_binary245_v0"; + echo "$__AF_pull_binary245_v0__68_15" > /dev/null 2>&1 fi file_exists__33_v0 "${nix_path}"; __AF_file_exists33_v0__71_8="$__AF_file_exists33_v0"; @@ -1770,65 +1833,65 @@ fi teardown__136_v0 0; __AF_teardown136_v0__72_9="$__AF_teardown136_v0"; echo "$__AF_teardown136_v0__72_9" > /dev/null 2>&1 - __AF_get_nix386_v0=0; + __AF_get_nix393_v0=0; return 0 fi env_var_test__87_v0 "nobins"; __AF_env_var_test87_v0__76_8="$__AF_env_var_test87_v0"; if [ "$__AF_env_var_test87_v0__76_8" != 0 ]; then - try_build_nix__383_v0 ; + try_build_nix__390_v0 ; __AS=$?; if [ $__AS != 0 ]; then teardown__136_v0 1; __AF_teardown136_v0__78_13="$__AF_teardown136_v0"; echo "$__AF_teardown136_v0__78_13" > /dev/null 2>&1 - __AF_get_nix386_v0=''; + __AF_get_nix393_v0=''; return 1 fi; - __AF_try_build_nix383_v0__77_9="$__AF_try_build_nix383_v0"; - echo "$__AF_try_build_nix383_v0__77_9" > /dev/null 2>&1 + __AF_try_build_nix390_v0__77_9="$__AF_try_build_nix390_v0"; + echo "$__AF_try_build_nix390_v0__77_9" > /dev/null 2>&1 fi - pull_binary__241_v0 "nix.${system}" "${nix_path}"; + pull_binary__245_v0 "nix.${system}" "${nix_path}"; __AS=$?; if [ $__AS != 0 ]; then - try_build_nix__383_v0 ; + try_build_nix__390_v0 ; __AS=$?; if [ $__AS != 0 ]; then teardown__136_v0 1; __AF_teardown136_v0__86_13="$__AF_teardown136_v0"; echo "$__AF_teardown136_v0__86_13" > /dev/null 2>&1 - __AF_get_nix386_v0=''; + __AF_get_nix393_v0=''; return 1 fi; - __AF_try_build_nix383_v0__85_9="$__AF_try_build_nix383_v0"; - echo "$__AF_try_build_nix383_v0__85_9" > /dev/null 2>&1 + __AF_try_build_nix390_v0__85_9="$__AF_try_build_nix390_v0"; + echo "$__AF_try_build_nix390_v0__85_9" > /dev/null 2>&1 fi; - __AF_pull_binary241_v0__84_5="$__AF_pull_binary241_v0"; - echo "$__AF_pull_binary241_v0__84_5" > /dev/null 2>&1 + __AF_pull_binary245_v0__84_5="$__AF_pull_binary245_v0"; + echo "$__AF_pull_binary245_v0__84_5" > /dev/null 2>&1 chmod +x ${nix_path}; __AS=$? teardown__136_v0 0; __AF_teardown136_v0__93_5="$__AF_teardown136_v0"; echo "$__AF_teardown136_v0__93_5" > /dev/null 2>&1 - __AF_get_nix386_v0=0; + __AF_get_nix393_v0=0; return 0 } -migrate_nix_store__387_v0() { +migrate_nix_store__394_v0() { local nix_root="" - get_nix_root__158_v0 ; - __AF_get_nix_root158_v0__105_30="${__AF_get_nix_root158_v0}"; - __AMBER_VAL_68=$(readlink -f ${__AF_get_nix_root158_v0__105_30}); + get_nix_root__159_v0 ; + __AF_get_nix_root159_v0__105_30="${__AF_get_nix_root159_v0}"; + __AMBER_VAL_69=$(readlink -f ${__AF_get_nix_root159_v0__105_30}); __AS=$?; if [ $__AS != 0 ]; then - get_nix_root__158_v0 ; - __AF_get_nix_root158_v0__106_20="${__AF_get_nix_root158_v0}"; - nix_root="${__AF_get_nix_root158_v0__106_20}" + get_nix_root__159_v0 ; + __AF_get_nix_root159_v0__106_20="${__AF_get_nix_root159_v0}"; + nix_root="${__AF_get_nix_root159_v0__106_20}" fi; - nix_root="${__AMBER_VAL_68}" + nix_root="${__AMBER_VAL_69}" dir_exists__32_v0 "${nix_root}/nix/store"; __AF_dir_exists32_v0__109_12="$__AF_dir_exists32_v0"; if [ $(echo '!' "$__AF_dir_exists32_v0__109_12" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - __AF_migrate_nix_store387_v0=0; + __AF_migrate_nix_store394_v0=0; return 0 fi echo "Migrating Nix store to system-wide install..." @@ -1839,10 +1902,10 @@ fi __AS=$? fi } -unpack_channels__388_v0() { - get_repo_root__160_v0 ; - __AF_get_repo_root160_v0__123_21="${__AF_get_repo_root160_v0}"; - local repo_root="${__AF_get_repo_root160_v0__123_21}" +unpack_channels__395_v0() { + get_repo_root__161_v0 ; + __AF_get_repo_root161_v0__123_21="${__AF_get_repo_root161_v0}"; + local repo_root="${__AF_get_repo_root161_v0__123_21}" get_self__141_v0 ; __AF_get_self141_v0__125_52="${__AF_get_self141_v0}"; exists_newer__139_v0 "${repo_root}/.nixie/channels" "${__AF_get_self141_v0__125_52}"; @@ -1858,7 +1921,7 @@ unpack_channels__388_v0() { echo "$__AF_env_var_set90_v0__127_15" > /dev/null 2>&1 export NIX_PATH; __AS=$? - __AF_unpack_channels388_v0=0; + __AF_unpack_channels395_v0=0; return 0 fi echo "Unpacking Nix channels, hang tight..." @@ -1874,9 +1937,9 @@ fi; __AF_untar143_v0__134_5="${__AF_untar143_v0}"; echo "${__AF_untar143_v0__134_5}" > /dev/null 2>&1 } -populate_extras__389_v0() { - __AMBER_ARRAY_69=(); - local args=("${__AMBER_ARRAY_69[@]}") +populate_extras__396_v0() { + __AMBER_ARRAY_70=(); + local args=("${__AMBER_ARRAY_70[@]}") env_var_get__91_v0 "EXTRA_FEATURES"; __AS=$?; __AF_env_var_get91_v0__146_43="${__AF_env_var_get91_v0}"; @@ -1889,44 +1952,44 @@ populate_extras__389_v0() { __AS=$?; __AF_env_var_get91_v0__148_43="${__AF_env_var_get91_v0}"; local EXTRA_TRUSTED_PUBLIC_KEYS="${__AF_env_var_get91_v0__148_43}" - get_nix_root__158_v0 ; - __AF_get_nix_root158_v0__150_20="${__AF_get_nix_root158_v0}"; - local nix_root="${__AF_get_nix_root158_v0__150_20}" + get_nix_root__159_v0 ; + __AF_get_nix_root159_v0__150_20="${__AF_get_nix_root159_v0}"; + local nix_root="${__AF_get_nix_root159_v0__150_20}" if [ $([ "_${EXTRA_FEATURES}" == "_" ]; echo $?) != 0 ]; then - __AMBER_ARRAY_70=("--extra-experimental-features" "${EXTRA_FEATURES}"); - args+=("${__AMBER_ARRAY_70[@]}") + __AMBER_ARRAY_71=("--extra-experimental-features" "${EXTRA_FEATURES}"); + args+=("${__AMBER_ARRAY_71[@]}") fi if [ $([ "_${EXTRA_SUBSTITUTERS}" == "_" ]; echo $?) != 0 ]; then - __AMBER_ARRAY_71=("--extra-substituters" "${EXTRA_SUBSTITUTERS}"); - args+=("${__AMBER_ARRAY_71[@]}") + __AMBER_ARRAY_72=("--extra-substituters" "${EXTRA_SUBSTITUTERS}"); + args+=("${__AMBER_ARRAY_72[@]}") fi if [ $([ "_${EXTRA_TRUSTED_PUBLIC_KEYS}" == "_" ]; echo $?) != 0 ]; then - __AMBER_ARRAY_72=("--extra-trusted-public-keys" "${EXTRA_TRUSTED_PUBLIC_KEYS}"); - args+=("${__AMBER_ARRAY_72[@]}") + __AMBER_ARRAY_73=("--extra-trusted-public-keys" "${EXTRA_TRUSTED_PUBLIC_KEYS}"); + args+=("${__AMBER_ARRAY_73[@]}") fi - get_osname__154_v0 ; - __AF_get_osname154_v0__161_8="${__AF_get_osname154_v0}"; - is_nix_installed__385_v0 ; - __AF_is_nix_installed385_v0__161_41="$__AF_is_nix_installed385_v0"; - if [ $(echo $([ "_${__AF_get_osname154_v0__161_8}" == "_Darwin" ]; echo $?) '&&' $(echo '!' "$__AF_is_nix_installed385_v0__161_41" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - __AMBER_VAL_74=$(readlink -f ${nix_root}); + get_osname__155_v0 ; + __AF_get_osname155_v0__161_8="${__AF_get_osname155_v0}"; + is_nix_installed__392_v0 ; + __AF_is_nix_installed392_v0__161_41="$__AF_is_nix_installed392_v0"; + if [ $(echo $([ "_${__AF_get_osname155_v0__161_8}" == "_Darwin" ]; echo $?) '&&' $(echo '!' "$__AF_is_nix_installed392_v0__161_41" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then + __AMBER_VAL_75=$(readlink -f ${nix_root}); __AS=$?; - __AMBER_ARRAY_73=("--store" "${__AMBER_VAL_74}"); - args+=("${__AMBER_ARRAY_73[@]}") + __AMBER_ARRAY_74=("--store" "${__AMBER_VAL_75}"); + args+=("${__AMBER_ARRAY_74[@]}") fi - __AF_populate_extras389_v0=("${args[@]}"); + __AF_populate_extras396_v0=("${args[@]}"); return 0 } -launch_darwin_workaround__390_v0() { +launch_darwin_workaround__397_v0() { local name=$1 local nix_path=$2 local args=("${!3}") - get_cache_root__159_v0 ; - __AF_get_cache_root159_v0__176_22="${__AF_get_cache_root159_v0}"; - local cache_root="${__AF_get_cache_root159_v0__176_22}" - get_nix_root__158_v0 ; - __AF_get_nix_root158_v0__177_20="${__AF_get_nix_root158_v0}"; - local nix_root="${__AF_get_nix_root158_v0__177_20}" + get_cache_root__160_v0 ; + __AF_get_cache_root160_v0__176_22="${__AF_get_cache_root160_v0}"; + local cache_root="${__AF_get_cache_root160_v0__176_22}" + get_nix_root__159_v0 ; + __AF_get_nix_root159_v0__177_20="${__AF_get_nix_root159_v0}"; + local nix_root="${__AF_get_nix_root159_v0__177_20}" local fakedir_path="${cache_root}/nix-deps/lib/libfakedir.dylib" env_var_set__90_v0 "FAKEDIR_PATTERN" "/nix"; __AS=$?; @@ -1941,60 +2004,60 @@ launch_darwin_workaround__390_v0() { _NIX_TEST_NO_SANDBOX=1 DYLD_INSERT_LIBRARIES="${fakedir_path}" DYLD_LIBRARY_PATH="${cache_root}/nix-deps/lib" exec -a ${name} ${nix_path} "${args[@]}"; __AS=$? } -launch_shell_command__391_v0() { +launch_shell_command__398_v0() { local nix_path=$1 local cmd=$2 local extras=("${!3}") local args=("${!4}") - get_repo_root__160_v0 ; - __AF_get_repo_root160_v0__205_21="${__AF_get_repo_root160_v0}"; - local repo_root="${__AF_get_repo_root160_v0__205_21}" + get_repo_root__161_v0 ; + __AF_get_repo_root161_v0__205_21="${__AF_get_repo_root161_v0}"; + local repo_root="${__AF_get_repo_root161_v0__205_21}" env_var_get__91_v0 "PWD"; __AS=$?; __AF_env_var_get91_v0__206_21="${__AF_env_var_get91_v0}"; local pwd="${__AF_env_var_get91_v0__206_21}" local name="nix-shell" - __AMBER_ARRAY_75=("${repo_root}/shell.nix" "--command" "${cmd} ${args[@]}"); - local shell_cmd=("${__AMBER_ARRAY_75[@]}") + __AMBER_ARRAY_76=("${repo_root}/shell.nix" "--command" "${cmd} ${args[@]}"); + local shell_cmd=("${__AMBER_ARRAY_76[@]}") file_exists__33_v0 "${pwd}/flake.nix"; __AF_file_exists33_v0__210_8="$__AF_file_exists33_v0"; if [ "$__AF_file_exists33_v0__210_8" != 0 ]; then name="nix" - __AMBER_ARRAY_76=("develop" "${pwd}" "-c" "${cmd}"); - __AMBER_ARRAY_ADD_77=("${__AMBER_ARRAY_76[@]}" "${args[@]}"); - shell_cmd=("${__AMBER_ARRAY_ADD_77[@]}") + __AMBER_ARRAY_77=("develop" "${pwd}" "-c" "${cmd}"); + __AMBER_ARRAY_ADD_78=("${__AMBER_ARRAY_77[@]}" "${args[@]}"); + shell_cmd=("${__AMBER_ARRAY_ADD_78[@]}") else file_exists__33_v0 "${repo_root}/flake.nix"; __AF_file_exists33_v0__213_16="$__AF_file_exists33_v0"; if [ "$__AF_file_exists33_v0__213_16" != 0 ]; then name="nix" - __AMBER_ARRAY_78=("develop" "${repo_root}" "-c" "${cmd}"); - __AMBER_ARRAY_ADD_79=("${__AMBER_ARRAY_78[@]}" "${args[@]}"); - shell_cmd=("${__AMBER_ARRAY_ADD_79[@]}") + __AMBER_ARRAY_79=("develop" "${repo_root}" "-c" "${cmd}"); + __AMBER_ARRAY_ADD_80=("${__AMBER_ARRAY_79[@]}" "${args[@]}"); + shell_cmd=("${__AMBER_ARRAY_ADD_80[@]}") else file_exists__33_v0 "${pwd}/shell.nix"; __AF_file_exists33_v0__216_16="$__AF_file_exists33_v0"; if [ "$__AF_file_exists33_v0__216_16" != 0 ]; then - __AMBER_ARRAY_80=("${pwd}/shell.nix" "--command" "${cmd} ${args[@]}"); - shell_cmd=("${__AMBER_ARRAY_80[@]}") + __AMBER_ARRAY_81=("${pwd}/shell.nix" "--command" "${cmd} ${args[@]}"); + shell_cmd=("${__AMBER_ARRAY_81[@]}") fi fi fi - get_osname__154_v0 ; - __AF_get_osname154_v0__220_8="${__AF_get_osname154_v0}"; - is_nix_installed__385_v0 ; - __AF_is_nix_installed385_v0__220_41="$__AF_is_nix_installed385_v0"; - if [ $(echo $([ "_${__AF_get_osname154_v0__220_8}" != "_Darwin" ]; echo $?) '&&' $(echo '!' "$__AF_is_nix_installed385_v0__220_41" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - __AMBER_ARRAY_ADD_81=("${extras[@]}" "${shell_cmd[@]}"); - launch_darwin_workaround__390_v0 "${name}" "${nix_path}" __AMBER_ARRAY_ADD_81[@]; - __AF_launch_darwin_workaround390_v0__221_9="$__AF_launch_darwin_workaround390_v0"; - echo "$__AF_launch_darwin_workaround390_v0__221_9" > /dev/null 2>&1 + get_osname__155_v0 ; + __AF_get_osname155_v0__220_8="${__AF_get_osname155_v0}"; + is_nix_installed__392_v0 ; + __AF_is_nix_installed392_v0__220_41="$__AF_is_nix_installed392_v0"; + if [ $(echo $([ "_${__AF_get_osname155_v0__220_8}" != "_Darwin" ]; echo $?) '&&' $(echo '!' "$__AF_is_nix_installed392_v0__220_41" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then + __AMBER_ARRAY_ADD_82=("${extras[@]}" "${shell_cmd[@]}"); + launch_darwin_workaround__397_v0 "${name}" "${nix_path}" __AMBER_ARRAY_ADD_82[@]; + __AF_launch_darwin_workaround397_v0__221_9="$__AF_launch_darwin_workaround397_v0"; + echo "$__AF_launch_darwin_workaround397_v0__221_9" > /dev/null 2>&1 else exec -a ${name} ${nix_path} "${extras[@]}" "${shell_cmd[@]}"; __AS=$? fi } -launch_nix_shebang__392_v0() { +launch_nix_shebang__399_v0() { local nix_path=$1 local file=$2 local extras=("${!3}") @@ -2011,7 +2074,7 @@ done <"${file}" starts_with__20_v0 "${shebang}" "#"'!'""; __AF_starts_with20_v0__247_12="$__AF_starts_with20_v0"; if [ $(echo '!' "$__AF_starts_with20_v0__247_12" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - __AF_launch_nix_shebang392_v0=''; + __AF_launch_nix_shebang399_v0=''; return 0 fi slice__22_v0 "${shebang}" 2 0; @@ -2031,33 +2094,33 @@ for arg in "${bang_args[@]}"; do fi (( i++ )) || true done - get_osname__154_v0 ; - __AF_get_osname154_v0__261_8="${__AF_get_osname154_v0}"; - is_nix_installed__385_v0 ; - __AF_is_nix_installed385_v0__261_41="$__AF_is_nix_installed385_v0"; - if [ $(echo $([ "_${__AF_get_osname154_v0__261_8}" != "_Darwin" ]; echo $?) '&&' $(echo '!' "$__AF_is_nix_installed385_v0__261_41" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - __AMBER_ARRAY_ADD_82=("${extras[@]}" "${bang_args[@]}"); - launch_darwin_workaround__390_v0 "${name}" "${nix_path}" __AMBER_ARRAY_ADD_82[@]; - __AF_launch_darwin_workaround390_v0__262_9="$__AF_launch_darwin_workaround390_v0"; - echo "$__AF_launch_darwin_workaround390_v0__262_9" > /dev/null 2>&1 + get_osname__155_v0 ; + __AF_get_osname155_v0__261_8="${__AF_get_osname155_v0}"; + is_nix_installed__392_v0 ; + __AF_is_nix_installed392_v0__261_41="$__AF_is_nix_installed392_v0"; + if [ $(echo $([ "_${__AF_get_osname155_v0__261_8}" != "_Darwin" ]; echo $?) '&&' $(echo '!' "$__AF_is_nix_installed392_v0__261_41" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then + __AMBER_ARRAY_ADD_83=("${extras[@]}" "${bang_args[@]}"); + launch_darwin_workaround__397_v0 "${name}" "${nix_path}" __AMBER_ARRAY_ADD_83[@]; + __AF_launch_darwin_workaround397_v0__262_9="$__AF_launch_darwin_workaround397_v0"; + echo "$__AF_launch_darwin_workaround397_v0__262_9" > /dev/null 2>&1 else exec -a ${name} ${nix_path} "${extras[@]}" "${bang_args[@]}"; __AS=$? fi } -launch_nix__393_v0() { +launch_nix__400_v0() { local self=$1 local args=("${!2}") - get_cache_root__159_v0 ; - __AF_get_cache_root159_v0__272_22="${__AF_get_cache_root159_v0}"; - local cache_root="${__AF_get_cache_root159_v0__272_22}" - get_nix_root__158_v0 ; - __AF_get_nix_root158_v0__273_20="${__AF_get_nix_root158_v0}"; - local nix_root="${__AF_get_nix_root158_v0__273_20}" + get_cache_root__160_v0 ; + __AF_get_cache_root160_v0__272_22="${__AF_get_cache_root160_v0}"; + local cache_root="${__AF_get_cache_root160_v0__272_22}" + get_nix_root__159_v0 ; + __AF_get_nix_root159_v0__273_20="${__AF_get_nix_root159_v0}"; + local nix_root="${__AF_get_nix_root159_v0__273_20}" local nix_path="${cache_root}/nix-static" - populate_extras__389_v0 ; - __AF_populate_extras389_v0__277_18=("${__AF_populate_extras389_v0[@]}"); - local extras=("${__AF_populate_extras389_v0__277_18[@]}") + populate_extras__396_v0 ; + __AF_populate_extras396_v0__277_18=("${__AF_populate_extras396_v0[@]}"); + local extras=("${__AF_populate_extras396_v0__277_18[@]}") split__3_v0 "${self}" "/"; __AF_split3_v0__278_27=("${__AF_split3_v0[@]}"); array_last__116_v0 __AF_split3_v0__278_27[@]; @@ -2066,59 +2129,66 @@ launch_nix__393_v0() { starts_with__20_v0 "${name}" "nix-"; __AF_starts_with20_v0__280_8="$__AF_starts_with20_v0"; if [ "$__AF_starts_with20_v0__280_8" != 0 ]; then - unpack_channels__388_v0 ; - __AF_unpack_channels388_v0__281_15="$__AF_unpack_channels388_v0"; - echo "$__AF_unpack_channels388_v0__281_15" > /dev/null 2>&1 -fi - is_nix_installed__385_v0 ; - __AF_is_nix_installed385_v0__283_8="$__AF_is_nix_installed385_v0"; - if [ "$__AF_is_nix_installed385_v0__283_8" != 0 ]; then - migrate_nix_store__387_v0 ; - __AF_migrate_nix_store387_v0__284_9="$__AF_migrate_nix_store387_v0"; - echo "$__AF_migrate_nix_store387_v0__284_9" > /dev/null 2>&1 + unpack_channels__395_v0 ; + __AF_unpack_channels395_v0__281_15="$__AF_unpack_channels395_v0"; + echo "$__AF_unpack_channels395_v0__281_15" > /dev/null 2>&1 +fi + is_nix_installed__392_v0 ; + __AF_is_nix_installed392_v0__283_8="$__AF_is_nix_installed392_v0"; + if [ "$__AF_is_nix_installed392_v0__283_8" != 0 ]; then + migrate_nix_store__394_v0 ; + __AF_migrate_nix_store394_v0__284_9="$__AF_migrate_nix_store394_v0"; + echo "$__AF_migrate_nix_store394_v0__284_9" > /dev/null 2>&1 nix_path="nix" else - get_nix__386_v0 ; + get_nix__393_v0 ; __AS=$?; if [ $__AS != 0 ]; then bail__140_v0 "Failed to obtain Nix. Check your internet connection." 0; __AF_bail140_v0__288_13="$__AF_bail140_v0"; echo "$__AF_bail140_v0__288_13" > /dev/null 2>&1 fi; - __AF_get_nix386_v0__287_9="$__AF_get_nix386_v0"; - echo "$__AF_get_nix386_v0__287_9" > /dev/null 2>&1 + __AF_get_nix393_v0__287_9="$__AF_get_nix393_v0"; + echo "$__AF_get_nix393_v0__287_9" > /dev/null 2>&1 + check_sandbox__163_v0 ; + __AF_check_sandbox163_v0__290_16="$__AF_check_sandbox163_v0"; + if [ $(echo '!' "$__AF_check_sandbox163_v0__290_16" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then + bail__140_v0 "Issues that prevent the Nix sandbox from working have been detected." 0; + __AF_bail140_v0__291_13="$__AF_bail140_v0"; + echo "$__AF_bail140_v0__291_13" > /dev/null 2>&1 +fi fi export NIX_SSL_CERT_FILE; __AS=$? file_exists__33_v0 "${args[0]}"; - __AF_file_exists33_v0__294_8="$__AF_file_exists33_v0"; + __AF_file_exists33_v0__297_8="$__AF_file_exists33_v0"; ends_with__21_v0 "${args[0]}" ".nix"; - __AF_ends_with21_v0__294_37="$__AF_ends_with21_v0"; - if [ $(echo "$__AF_file_exists33_v0__294_8" '&&' $(echo '!' "$__AF_ends_with21_v0__294_37" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then + __AF_ends_with21_v0__297_37="$__AF_ends_with21_v0"; + if [ $(echo "$__AF_file_exists33_v0__297_8" '&&' $(echo '!' "$__AF_ends_with21_v0__297_37" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then local args_shebang=("${args[@]}") array_shift__120_v0 args_shebang; - __AF_array_shift120_v0__296_9="${__AF_array_shift120_v0}"; - echo "${__AF_array_shift120_v0__296_9}" > /dev/null 2>&1 - launch_nix_shebang__392_v0 "${nix_path}" "${args[0]}" extras[@] args_shebang[@]; - __AF_launch_nix_shebang392_v0__297_9="$__AF_launch_nix_shebang392_v0"; - echo "$__AF_launch_nix_shebang392_v0__297_9" > /dev/null 2>&1 + __AF_array_shift120_v0__299_9="${__AF_array_shift120_v0}"; + echo "${__AF_array_shift120_v0__299_9}" > /dev/null 2>&1 + launch_nix_shebang__399_v0 "${nix_path}" "${args[0]}" extras[@] args_shebang[@]; + __AF_launch_nix_shebang399_v0__300_9="$__AF_launch_nix_shebang399_v0"; + echo "$__AF_launch_nix_shebang399_v0__300_9" > /dev/null 2>&1 fi starts_with__20_v0 "${name}" "nix"; - __AF_starts_with20_v0__300_12="$__AF_starts_with20_v0"; - if [ $(echo '!' "$__AF_starts_with20_v0__300_12" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - launch_shell_command__391_v0 "${nix_path}" "${name}" extras[@] args[@]; - __AF_launch_shell_command391_v0__301_9="$__AF_launch_shell_command391_v0"; - echo "$__AF_launch_shell_command391_v0__301_9" > /dev/null 2>&1 -fi - get_osname__154_v0 ; - __AF_get_osname154_v0__304_8="${__AF_get_osname154_v0}"; - is_nix_installed__385_v0 ; - __AF_is_nix_installed385_v0__304_41="$__AF_is_nix_installed385_v0"; - if [ $(echo $([ "_${__AF_get_osname154_v0__304_8}" != "_Darwin" ]; echo $?) '&&' $(echo '!' "$__AF_is_nix_installed385_v0__304_41" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then - __AMBER_ARRAY_ADD_83=("${extras[@]}" "${args[@]}"); - launch_darwin_workaround__390_v0 "${name}" "${nix_path}" __AMBER_ARRAY_ADD_83[@]; - __AF_launch_darwin_workaround390_v0__305_9="$__AF_launch_darwin_workaround390_v0"; - echo "$__AF_launch_darwin_workaround390_v0__305_9" > /dev/null 2>&1 + __AF_starts_with20_v0__303_12="$__AF_starts_with20_v0"; + if [ $(echo '!' "$__AF_starts_with20_v0__303_12" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then + launch_shell_command__398_v0 "${nix_path}" "${name}" extras[@] args[@]; + __AF_launch_shell_command398_v0__304_9="$__AF_launch_shell_command398_v0"; + echo "$__AF_launch_shell_command398_v0__304_9" > /dev/null 2>&1 +fi + get_osname__155_v0 ; + __AF_get_osname155_v0__307_8="${__AF_get_osname155_v0}"; + is_nix_installed__392_v0 ; + __AF_is_nix_installed392_v0__307_41="$__AF_is_nix_installed392_v0"; + if [ $(echo $([ "_${__AF_get_osname155_v0__307_8}" != "_Darwin" ]; echo $?) '&&' $(echo '!' "$__AF_is_nix_installed392_v0__307_41" | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') | bc -l | sed '/\./ s/\.\{0,1\}0\{1,\}$//') != 0 ]; then + __AMBER_ARRAY_ADD_84=("${extras[@]}" "${args[@]}"); + launch_darwin_workaround__397_v0 "${name}" "${nix_path}" __AMBER_ARRAY_ADD_84[@]; + __AF_launch_darwin_workaround397_v0__308_9="$__AF_launch_darwin_workaround397_v0"; + echo "$__AF_launch_darwin_workaround397_v0__308_9" > /dev/null 2>&1 else exec -a ${name} ${nix_path} "${extras[@]}" "${args[@]}"; __AS=$? @@ -2131,17 +2201,17 @@ __3_EXTRA_FEATURES="" __4_EXTRA_SUBSTITUTERS="" __5_EXTRA_TRUSTED_PUBLIC_KEYS="" __6_NIXIE_VERSION="" -__AMBER_ARRAY_84=(); -__7_args=("${__AMBER_ARRAY_84[@]}") -__AMBER_ARRAY_85=("tar" "gzip" "uname"); -check_deps__144_v0 __AMBER_ARRAY_85[@]; +__AMBER_ARRAY_85=(); +__7_args=("${__AMBER_ARRAY_85[@]}") +__AMBER_ARRAY_86=("tar" "gzip" "uname"); +check_deps__144_v0 __AMBER_ARRAY_86[@]; __AS=$?; if [ $__AS != 0 ]; then exit 1 fi; __AF_check_deps144_v0__26_1="$__AF_check_deps144_v0"; echo "$__AF_check_deps144_v0__26_1" > /dev/null 2>&1 -load_features__395_v0() { +load_features__402_v0() { untar__143_v0 "features" 1; __AS=$?; if [ $__AS != 0 ]; then @@ -2189,36 +2259,36 @@ fi } declare -r cmdl=("$0" "$@") __7_args=("${cmdl[@]}") - load_features__395_v0 ; - __AF_load_features395_v0__62_5="$__AF_load_features395_v0"; - echo "$__AF_load_features395_v0__62_5" > /dev/null 2>&1 - catch_args__182_v0 __7_args; - __AF_catch_args182_v0__63_5="$__AF_catch_args182_v0"; - echo "$__AF_catch_args182_v0__63_5" > /dev/null 2>&1 + load_features__402_v0 ; + __AF_load_features402_v0__62_5="$__AF_load_features402_v0"; + echo "$__AF_load_features402_v0__62_5" > /dev/null 2>&1 + catch_args__185_v0 __7_args; + __AF_catch_args185_v0__63_5="$__AF_catch_args185_v0"; + echo "$__AF_catch_args185_v0__63_5" > /dev/null 2>&1 array_shift__120_v0 __7_args; __AF_array_shift120_v0__65_16="${__AF_array_shift120_v0}"; self="${__AF_array_shift120_v0__65_16}" file_exists__33_v0 "/etc/pki/tls/certs/ca-bundle.crt"; __AF_file_exists33_v0__69_5="$__AF_file_exists33_v0"; - get_osname__154_v0 ; - __AF_get_osname154_v0__71_5="${__AF_get_osname154_v0}"; + get_osname__155_v0 ; + __AF_get_osname155_v0__71_5="${__AF_get_osname155_v0}"; if [ "$__AF_file_exists33_v0__69_5" != 0 ]; then env_var_set__90_v0 "NIX_SSL_CERT_FILE" "/etc/pki/tls/certs/ca-bundle.crt"; __AS=$?; __AF_env_var_set90_v0__70_15="$__AF_env_var_set90_v0"; echo "$__AF_env_var_set90_v0__70_15" > /dev/null 2>&1 -elif [ $([ "_${__AF_get_osname154_v0__71_5}" != "_Darwin" ]; echo $?) != 0 ]; then +elif [ $([ "_${__AF_get_osname155_v0__71_5}" != "_Darwin" ]; echo $?) != 0 ]; then env_var_set__90_v0 "NIX_SSL_CERT_FILE" "/etc/ssl/cert.pem"; __AS=$?; __AF_env_var_set90_v0__72_15="$__AF_env_var_set90_v0"; echo "$__AF_env_var_set90_v0__72_15" > /dev/null 2>&1 fi - launch_nix__393_v0 "${self}" __7_args[@]; - __AF_launch_nix393_v0__75_5="$__AF_launch_nix393_v0"; - echo "$__AF_launch_nix393_v0__75_5" > /dev/null 2>&1 + launch_nix__400_v0 "${self}" __7_args[@]; + __AF_launch_nix400_v0__75_5="$__AF_launch_nix400_v0"; + echo "$__AF_launch_nix400_v0__75_5" > /dev/null 2>&1 exit 0 cat <q!,\NIm`0vEFpтM}4=N{gZOźT~ivpt NQ͓Dܵ'jqߥޤǗ~2G]d]:mm3s6{4xW/v}סc9ϴ]Z0E/}yDe l)CTur٩coZ7(Hwfll}W%!yު ͝!FEk\%x@ԾP; +.gn@`>q!,\NIm`0vEFpтM}4=N{gZOźT~ivpt NQ͓Dܵ'jqߥޤǗ~2G]d]:mm3s6{4xW/v}סc9ϴ]Z0E/}yDe l)CTur٩coZ7(Hwfll}W%!yު ͝!FEk\%x@ԾP; _ ˡ([?1049l # (tarball data) \ No newline at end of file diff --git a/src/nix.ab b/src/nix.ab index aa566aa..52d84a0 100644 --- a/src/nix.ab +++ b/src/nix.ab @@ -9,8 +9,8 @@ import { array_last, array_shift } from "std/array" import { enter_alt_buffer, set_title, teardown } from "./term.ab" import { bail, untar, exists_newer, get_self } from "./common.ab" -import { get_osname, get_system, get_cache_root - , get_nix_root, get_repo_root } from "./platform.ab" +import { get_osname, get_system, get_cache_root, get_nix_root + , get_repo_root, check_sandbox } from "./platform.ab" import { pull_binary } from "./resources.ab" import { try_build_nix } from "./builders.ab" @@ -287,6 +287,9 @@ pub fun launch_nix(self: Text, args: [Text]): Null get_nix() failed { bail("Failed to obtain Nix. Check your internet connection.") } + if not check_sandbox() { + bail("Issues that prevent the Nix sandbox from working have been detected.") + } } trust $export NIX_SSL_CERT_FILE$ diff --git a/src/platform.ab b/src/platform.ab index 82a028e..72f7e58 100644 --- a/src/platform.ab +++ b/src/platform.ab @@ -3,6 +3,7 @@ // Environment-specific data retrieval utilities import { env_var_get, echo_warning } from "std/env" +import { file_read } from "std/fs" import { split, join } from "std/text" import { array_pop } from "std/array" @@ -84,3 +85,36 @@ pub fun get_repo_root(): Text return self_dir } } + +fun read_sysctl(path: Text): Text? +{ + return silent file_read("/proc/sys/{path}")? +} + +/// Return True if the system is capable of running the unprivileged Nixie +/// sandbox, False otherwise. +pub fun check_sandbox(): Bool +{ + let osname = get_osname() + + if osname == "Linux" { + // Recent 6.x kernels lack this control as the feature is always enabled. + if trust read_sysctl("kernel/unprivileged_userns_clone") == "0" { + echo_warning("Unprivileged sandboxes are not allowed on this system.") + echo_warning("Running the following command as root may fix the issue:") + echo " sysctl kernel.unprivileged_userns_clone=1" + return false + } + // This control will only exist if AppArmor is active. + if trust read_sysctl("kernel/apparmor_restrict_unprivileged_userns") == "1" { + echo_warning("AppArmor is restricting unprivileged sandboxes on this system.") + echo_warning("Running the following command as root may fix the issue:") + echo " sysctl kernel.apparmor_restrict_unprivileged_userns=0" + return false + } + } else { + return true + } + + return true +}