mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-11 17:24:27 +00:00
ci: upgrade Nix from 2.3.12 to 2.6.1
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. We default to multi-user for Darwin, but not for any other OS due to discovered issues with `nix-daemon` socket on Arch and open file limits. I also rewrote `nix/scripts/setup.sh` and `/nix/scripts/purge.sh` to support different types of installations. Both single-user and multi-user, as some operating systems have issues with multi-user installations. Resolves: https://github.com/status-im/status-react/issues/12832 Depends on: https://github.com/status-im/status-jenkins-lib/pull/37 Related changes: * https://github.com/status-im/infra-ci/commit/84947b9f * https://github.com/status-im/infra-ci/commit/bb98f5f3 * https://github.com/status-im/infra-ci/commit/f75d524d * https://github.com/status-im/infra-ci/commit/d1fc92cd * https://github.com/status-im/infra-ci/commit/87c4091e * https://github.com/status-im/infra-ci/commit/8d6b6b3f * https://github.com/status-im/infra-ci/commit/c4f13285 * https://github.com/status-im/infra-ci/commit/38ac698d Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
da76200433
commit
0311983751
@ -1,7 +1,7 @@
|
||||
library 'status-jenkins-lib@v1.3.5'
|
||||
library 'status-jenkins-lib@v1.4.0'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux && x86_64 && nix-2.3' }
|
||||
agent { label 'linux && x86_64 && nix-2.6' }
|
||||
|
||||
options {
|
||||
timestamps()
|
||||
|
@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.3.5'
|
||||
library 'status-jenkins-lib@v1.4.0'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
@ -1,7 +1,7 @@
|
||||
library 'status-jenkins-lib@v1.3.5'
|
||||
library 'status-jenkins-lib@v1.4.0'
|
||||
|
||||
pipeline {
|
||||
agent { label 'macos && x86_64 && nix-2.3 && xcode-12.5' }
|
||||
agent { label 'macos && x86_64 && nix-2.6 && xcode-12.5' }
|
||||
|
||||
parameters {
|
||||
string(
|
||||
|
@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.3.5'
|
||||
library 'status-jenkins-lib@v1.4.0'
|
||||
|
||||
pipeline {
|
||||
agent { label params.AGENT_LABEL }
|
||||
|
@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.3.3'
|
||||
library 'status-jenkins-lib@v1.4.0'
|
||||
|
||||
pipeline {
|
||||
agent { label 'macos' }
|
||||
|
@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.3.3'
|
||||
library 'status-jenkins-lib@v1.4.0'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
@ -1,35 +1,33 @@
|
||||
# Known Issues
|
||||
|
||||
## MacOS 10.15 "Catalina"
|
||||
## Too many open files
|
||||
|
||||
There is an unsolved issue with the root(`/`) file system in `10.15` being read-only:
|
||||
https://github.com/NixOS/nix/issues/2925
|
||||
### Single-User Installation
|
||||
|
||||
Our current recommended workaround is putting `/nix` under `/opt/nix` and symlinking it via `/etc/synthetic.conf`:
|
||||
|
||||
```bash
|
||||
sudo mkdir /opt/nix
|
||||
sudo chown ${USER} /opt/nix
|
||||
sudo sh -c "echo 'nix\t/opt/nix' >> /etc/synthetic.conf"
|
||||
reboot
|
||||
Nix can open a lot of files when fetching things for `/nix/store` which can cause
|
||||
```
|
||||
|
||||
After the system reboots you should see the `/nix` symlink in place:
|
||||
|
||||
```bash
|
||||
% ls -l /nix
|
||||
lrwxr-xr-x 1 root wheel 8 Oct 11 13:53 /nix -> /opt/nix
|
||||
Too many open files"
|
||||
```
|
||||
|
||||
In order to be able to use Nix with a symlinked `/nix` you need to include this in your shell:
|
||||
|
||||
```bash
|
||||
export NIX_IGNORE_SYMLINK_STORE=1
|
||||
The temporary way to fix this is set a new limit for current session using `ulimit`:
|
||||
```sh
|
||||
ulimit -n 131072
|
||||
```
|
||||
To increase limit permanently system-wide edit `/etc/sysctl.conf`:
|
||||
```
|
||||
fs.file-max = 131072
|
||||
```
|
||||
And use `sudo sysctl --system` to load these new settings.
|
||||
|
||||
Add it to your `.bashrc` or any other shell config file.
|
||||
### Multi-User Installation
|
||||
|
||||
__NOTE__: Your old `/nix` directory will end up in `/Users/Shared/Relocated Items/Security/nix` after OS upgrade.
|
||||
The other reason why this error could appear are limits fo `nix-daemon` service:
|
||||
https://github.com/NixOS/nix/issues/6007
|
||||
|
||||
Since Systemd services ignore system-wide limits you will have to add the following line:
|
||||
```
|
||||
LimitNOFILE=4096:1048576
|
||||
```
|
||||
To the `/etc/systemd/system/nix-daemon.service` service definition.
|
||||
|
||||
## Cache Downloads Timing Out
|
||||
|
||||
@ -69,3 +67,11 @@ Currently on NixOS `NIX_CONF_DIR` is being ignored in favor of the default `/etc
|
||||
This will be possible to fix once Nix `2.4` comes out with support for `NIX_USER_CONF_FILES`.
|
||||
|
||||
For more details see https://github.com/NixOS/nix/issues/3723.
|
||||
|
||||
## Extra Sandbox Files Not Available
|
||||
|
||||
It's possible that on a multi-user installation files provided to the build sandbox using the `extra-sandbox-paths` option will ne be available, unless the current user is added to `trusted-users` in `nix.conf` file.
|
||||
|
||||
Issues:
|
||||
* https://github.com/NixOS/nix/issues/6115
|
||||
* https://github.com/NixOS/nix/issues/6217
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script is a wrapper around nix-build with some niceties.
|
||||
set -e
|
||||
|
||||
GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
|
||||
@ -8,7 +8,7 @@ source "${GIT_ROOT}/scripts/colors.sh"
|
||||
source "${GIT_ROOT}/nix/scripts/source.sh"
|
||||
|
||||
# cleanup for artifacts created during builds
|
||||
function cleanup() {
|
||||
cleanup() {
|
||||
# clear trapped signals
|
||||
trap - EXIT ERR INT QUIT
|
||||
# do the actual cleanup, ignore failure
|
||||
@ -29,7 +29,7 @@ if [[ -n "${_NIX_CLEAN}" ]]; then
|
||||
fi
|
||||
|
||||
# build output will end up under /nix, we have to extract it
|
||||
function extractResults() {
|
||||
extractResults() {
|
||||
local nixResultPath="$1"
|
||||
mkdir -p "${resultPath}"
|
||||
cp -vfr ${nixResultPath}/* "${resultPath}" | sed 's#'${PWD}'#.#'
|
||||
|
@ -5,16 +5,16 @@ set -e
|
||||
GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
|
||||
source "${GIT_ROOT}/nix/scripts/source.sh"
|
||||
|
||||
function log() { echo "$@" 1>&2; }
|
||||
log() { echo "$@" 1>&2; }
|
||||
|
||||
# helpers for getting related paths in Nix store
|
||||
function getSources() { nix-store --query --binding src "${1}"; }
|
||||
function getOutputs() { nix-store --query --outputs "${1}"; }
|
||||
function getDrvFiles() { nix-store --query --deriver "${1}"; }
|
||||
function getReferrers() { nix-store --query --referrers "${1}"; }
|
||||
function getRoots() { nix-store --query --roots "${1}"; }
|
||||
getSources() { nix-store --query --binding src "${1}"; }
|
||||
getOutputs() { nix-store --query --outputs "${1}"; }
|
||||
getDrvFiles() { nix-store --query --deriver "${1}"; }
|
||||
getReferrers() { nix-store --query --referrers "${1}"; }
|
||||
getRoots() { nix-store --query --roots "${1}"; }
|
||||
|
||||
function findRelated() {
|
||||
findRelated() {
|
||||
path="${1}"
|
||||
found+=("${path}")
|
||||
if [[ "${path}" =~ .*.chroot ]]; then
|
||||
@ -51,7 +51,7 @@ function findRelated() {
|
||||
}
|
||||
|
||||
# used to find things to delete based on a regex
|
||||
function findByRegex() {
|
||||
findByRegex() {
|
||||
regex="${1}"
|
||||
|
||||
log "Searching by regex: '${regex}'"
|
||||
@ -70,7 +70,7 @@ function findByRegex() {
|
||||
}
|
||||
|
||||
# used to find things to delete based on a given path
|
||||
function findByResult() {
|
||||
findByResult() {
|
||||
mainPath="${1}"
|
||||
log "Searching by result: '${mainPath}'"
|
||||
|
||||
|
37
nix/scripts/lib.sh
Executable file
37
nix/scripts/lib.sh
Executable file
@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Checking group ownership to identify installation type.
|
||||
file_group() {
|
||||
UNAME=$(uname -s)
|
||||
if [[ "${UNAME}" == "Linux" ]]; then
|
||||
stat -Lc "%G" "${1}" 2>/dev/null
|
||||
elif [[ "${UNAME}" == "Darwin" ]]; then
|
||||
stat -Lf "%Sg" "${1}" 2>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
os_name() {
|
||||
source /etc/os-release 2>/dev/null
|
||||
echo "${NAME}"
|
||||
}
|
||||
|
||||
is_arch_linux() {
|
||||
[[ -f /etc/arch-release ]]
|
||||
}
|
||||
|
||||
nix_install_type() {
|
||||
NIX_STORE_DIR_GROUP=$(file_group /nix/store)
|
||||
if [[ "$(os_name)" =~ NixOS ]]; then
|
||||
echo "nixos"
|
||||
elif [[ "${NIX_STORE_DIR_GROUP}" == "nixbld" ]]; then
|
||||
echo "multi"
|
||||
elif [[ "${NIX_STORE_DIR_GROUP}" == "${USER}" ]]; then
|
||||
echo "single"
|
||||
elif [[ "${NIX_STORE_DIR_GROUP}" == "" ]]; then
|
||||
echo "No Nix installtion detected!" >&2
|
||||
echo "none"
|
||||
else
|
||||
echo "Unknown Nix installtion type!" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
@ -23,13 +23,13 @@ source "${GIT_ROOT}/scripts/colors.sh"
|
||||
# More concise output from 'time'
|
||||
export TIMEFORMAT="Done in: %Es"
|
||||
|
||||
function removeDir() {
|
||||
removeDir() {
|
||||
[[ ! -d "${tmp}" ]] && return
|
||||
chmod -R u+w "${tmp}"
|
||||
rm -rf "${tmp}"
|
||||
}
|
||||
|
||||
function copyNodeModules() {
|
||||
copyNodeModules() {
|
||||
local src="${1}"
|
||||
local dst="${2}"
|
||||
# WARNING: The ../ is there to avoid a Nix builtins.path bug:
|
||||
@ -51,7 +51,7 @@ function copyNodeModules() {
|
||||
|
||||
# Find files that were modified and should cause a re-copying of node modules.
|
||||
# Some files are generated/modified by build processes and should be ignored.
|
||||
function findFilesNewerThan() {
|
||||
findFilesNewerThan() {
|
||||
local sentinel="${1}"
|
||||
local dir="${2}"
|
||||
find ${dir} -type f -writable \
|
||||
@ -63,7 +63,7 @@ function findFilesNewerThan() {
|
||||
-print
|
||||
}
|
||||
|
||||
function nodeModulesUnchanged() {
|
||||
nodeModulesUnchanged() {
|
||||
local src="$1"
|
||||
local dst="$2"
|
||||
local sentinelFile="${dst}/.copied~"
|
||||
@ -98,7 +98,7 @@ function nodeModulesUnchanged() {
|
||||
return 0
|
||||
}
|
||||
|
||||
function replaceNodeModules() {
|
||||
replaceNodeModules() {
|
||||
local src="$1"
|
||||
local dst="$2"
|
||||
local sentinelFile="${dst}/.copied~"
|
||||
|
@ -1,24 +1,82 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
# This script removes all Nix files.
|
||||
|
||||
GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
|
||||
source "${GIT_ROOT}/nix/scripts/lib.sh"
|
||||
source "${GIT_ROOT}/scripts/colors.sh"
|
||||
|
||||
# Purging /nix on NixOS would be disasterous
|
||||
if [[ -f "/etc/os-release" ]]; then
|
||||
OS_NAME=$(awk -F= '/^NAME/{print $2}' /etc/os-release)
|
||||
if [[ "$OS_NAME" == "NixOS" ]]; then
|
||||
echo -e "${RED}You should not purge Nix files on NixOS!${RST}" >&2
|
||||
exit
|
||||
nix_purge_multi_user() {
|
||||
sudo systemctl stop nix-daemon.socket
|
||||
sudo systemctl stop nix-daemon.service
|
||||
sudo systemctl disable nix-daemon.socket
|
||||
sudo systemctl disable nix-daemon.service
|
||||
sudo systemctl daemon-reload
|
||||
sudo rm -fr /etc/nix
|
||||
sudo rm -f /etc/profile.d/nix.sh*
|
||||
|
||||
# Remove nix build users and groups
|
||||
for NIX_USER in $(awk -F: '/nixbld/{print $1}' /etc/passwd); do
|
||||
sudo userdel "${NIX_USER}"
|
||||
done
|
||||
sudo groupdel nixbld
|
||||
|
||||
# Restore old shell profiles
|
||||
NIX_PROFILE_FILES=(
|
||||
/etc/bash.bashrc /etc/bashrc /etc/bash/bashrc
|
||||
/etc/zsh.zshhrc /etc/zshrc /etc/zsh/zshrc
|
||||
)
|
||||
for NIX_FILE in "${NIX_PROFILE_FILES[@]}"; do
|
||||
if [[ -f "${NIX_FILE}.backup-before-nix" ]]; then
|
||||
sudo mv -f "${NIX_FILE}.backup-before-nix" "${NIX_FILE}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
nix_purge_user_profile() {
|
||||
sudo rm -rf \
|
||||
~/.nix-* \
|
||||
~/.cache/nix \
|
||||
~/.config/nixpkgs \
|
||||
${GIT_ROOT}/.nix-gcroots
|
||||
}
|
||||
|
||||
nix_purge_root() {
|
||||
NIX_ROOT="/nix"
|
||||
if [[ $(uname -s) == "Darwin" ]]; then
|
||||
# Special case due to read-only root on MacOS Catalina
|
||||
NIX_ROOT="/opt/nix"
|
||||
fi
|
||||
if [[ -z "${NIX_ROOT}" ]]; then
|
||||
echo -e "${RED}Unable to identify Nix root!${RST}" >&2
|
||||
exit 1
|
||||
fi
|
||||
sudo rm -fr "${NIX_ROOT}"
|
||||
}
|
||||
|
||||
NIX_INSTALL_TYPE=$(nix_install_type)
|
||||
|
||||
if [[ "${1}" == "--force" ]] && [[ "${NIX_INSTALL_TYPE}" != "nixos" ]]; then
|
||||
echo -e "${YLW}Purge forced, no checks performed!${RST}" >&2
|
||||
nix_purge_multi_user
|
||||
nix_purge_user_profile
|
||||
nix_purge_root
|
||||
exit
|
||||
fi
|
||||
|
||||
NIX_ROOT="/nix"
|
||||
if [[ $(uname -s) == "Darwin" ]]; then
|
||||
# Special case due to read-only root on MacOS Catalina
|
||||
NIX_ROOT="/opt/nix"
|
||||
# Purging /nix on NixOS would be disasterous
|
||||
if [[ "${NIX_INSTALL_TYPE}" == "nixos" ]]; then
|
||||
echo -e "${RED}You should not purge Nix files on NixOS!${RST}" >&2
|
||||
exit
|
||||
elif [[ "${NIX_INSTALL_TYPE}" == "none" ]]; then
|
||||
echo -e "${YLW}Nothing to remove, Nix not installed.${RST}" >&2
|
||||
exit
|
||||
elif [[ "${NIX_INSTALL_TYPE}" == "multi" ]]; then
|
||||
echo -e "${YLW}Detected multi-user Nix installation.${RST}" >&2
|
||||
nix_purge_multi_user
|
||||
elif [[ "${NIX_INSTALL_TYPE}" == "single" ]]; then
|
||||
echo -e "${YLW}Detected single-user Nix installation.${RST}" >&2
|
||||
nix_purge_user_profile
|
||||
fi
|
||||
nix_purge_root
|
||||
|
||||
sudo rm -rf ${NIX_ROOT}/* ~/.nix-profile ~/.nix-defexpr ~/.nix-channels ~/.cache/nix ~/.status .nix-gcroots
|
||||
echo -e "${GRN}Purged all Nix files from your system.${RST}" >&2
|
||||
|
@ -1,51 +1,73 @@
|
||||
#!/usr/bin/env bash
|
||||
# This script installs a specific version of Nix.
|
||||
set -eo pipefail
|
||||
|
||||
GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
|
||||
source "${GIT_ROOT}/nix/scripts/lib.sh"
|
||||
source "${GIT_ROOT}/scripts/colors.sh"
|
||||
|
||||
NIX_VERSION="2.3.12"
|
||||
NIX_VERSION="2.6.1"
|
||||
NIX_INSTALL_URL="https://nixos.org/releases/nix/nix-${NIX_VERSION}/install"
|
||||
NIX_INSTALL_SHA256="468a49a1cef293d59508bb3b62625dfcd99ec00334a14309f125cf8de513d5f1"
|
||||
NIX_INSTALL_SHA256="a63732b4f3628ce97e096dbda88e3cb9851ff6b4f94b5cd43feb257126437b9d"
|
||||
NIX_INSTALL_PATH="/tmp/nix-install-${NIX_VERSION}"
|
||||
|
||||
function install_nix() {
|
||||
# Don't break people's profiles
|
||||
export NIX_INSTALLER_NO_MODIFY_PROFILE=1
|
||||
# Fix for installing on MacOS Catalina
|
||||
export NIX_IGNORE_SYMLINK_STORE=1
|
||||
# Download installer and verify SHA256
|
||||
curl -s "${NIX_INSTALL_URL}" -o "${NIX_INSTALL_PATH}"
|
||||
echo "${NIX_INSTALL_SHA256} ${NIX_INSTALL_PATH}" | sha256sum -c
|
||||
chmod +x "${NIX_INSTALL_PATH}"
|
||||
# Run the installer
|
||||
"${NIX_INSTALL_PATH}" --no-daemon
|
||||
if [ $? -eq 0 ]; then
|
||||
echo -e "${GRN}The Nix package manager was successfully installed.${RST}"
|
||||
else
|
||||
echo -e "${RED}Failed to install Nix package manager!${RST}" >&2
|
||||
echo "Please see: https://nixos.org/nix/manual/#chap-installation" >&2
|
||||
exit 1
|
||||
fi
|
||||
install_nix() {
|
||||
# Download installer and verify SHA256>
|
||||
curl -sSf "${NIX_INSTALL_URL}" -o "${NIX_INSTALL_PATH}"
|
||||
echo "${NIX_INSTALL_SHA256} ${NIX_INSTALL_PATH}" | sha256sum -c
|
||||
chmod +x "${NIX_INSTALL_PATH}"
|
||||
|
||||
# Identify installation type.
|
||||
if [[ -z "${NIX_INSTALL_OPTS}" ]]; then
|
||||
if [[ "$(uname -r)" =~ microsoft ]]; then
|
||||
# Systemd is not started by default on WSL.
|
||||
NIX_INSTALL_OPTS="--no-daemon"
|
||||
elif [[ "$(uname -s)" == "Darwin" ]]; then
|
||||
# Single-user not supported on Darwin.
|
||||
NIX_INSTALL_OPTS="--daemon"
|
||||
elif [[ "$(uname -s)" == "Linux" ]]; then
|
||||
# Open file limit issues on Linux.
|
||||
# https://github.com/NixOS/nix/issues/6007
|
||||
# Alson known issues with nix-daemon.socket on Arch.
|
||||
NIX_INSTALL_OPTS="--no-daemon"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Run the installer
|
||||
"${NIX_INSTALL_PATH}" "${NIX_INSTALL_OPTS}"
|
||||
if [[ $? -eq 0 ]]; then
|
||||
echo -e "${GRN}The Nix package manager was successfully installed.${RST}"
|
||||
else
|
||||
echo -e "${RED}Failed to install Nix package manager!${RST}" >&2
|
||||
echo "Please see: https://nixos.org/nix/manual/#chap-installation" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ ! -x "$(command -v sha256sum)" ]]; then
|
||||
echo -e "${RED}The 'sha256sum' utility is required for Nix installation.${RST}" >&2
|
||||
echo -e "${YLW}Install 'coreutils' package on your system.${RST}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -x "$(command -v curl)" ]]; then
|
||||
echo -e "${RED}The 'curl' utility is required for Nix installation.${RST}" >&2
|
||||
exit 1
|
||||
echo -e "${RED}The 'curl' utility is required for Nix installation.${RST}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$(source /etc/os-release 2>/dev/null && echo "${NAME}")" == *NixOS* ]]; then
|
||||
echo -e "${GRN}Already running NixOS.${RST}"
|
||||
exit
|
||||
echo -e "${GRN}Already running NixOS.${RST}"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ -x "$(command -v nix)" ]]; then
|
||||
echo -e "${GRN}Nix package manager already installed.${RST}"
|
||||
exit
|
||||
echo -e "${GRN}Nix package manager already installed.${RST}"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ "${IN_NIX_SHELL}" == 'pure' ]]; then
|
||||
echo -e "${GRN}Already in a pure Nix shell.${RST}"
|
||||
exit
|
||||
echo -e "${GRN}Already in a pure Nix shell.${RST}"
|
||||
exit
|
||||
fi
|
||||
|
||||
# If none of the checks before succeeded we need to install Nix
|
||||
|
@ -1,33 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script makes sure we have Nix tools available
|
||||
set -e
|
||||
|
||||
GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
|
||||
source "${GIT_ROOT}/nix/scripts/lib.sh"
|
||||
source "${GIT_ROOT}/scripts/colors.sh"
|
||||
|
||||
# Location of profile script for Nix that adjusts PATH
|
||||
export NIX_PROFILE_SH="${HOME}/.nix-profile/etc/profile.d/nix.sh"
|
||||
|
||||
function source_nix() {
|
||||
# Just stop if Nix is already available
|
||||
if [[ -x $(command -v nix) ]]; then
|
||||
return
|
||||
elif [[ -f "${NIX_PROFILE_SH}" ]]; then
|
||||
# Load Nix profile if it exists
|
||||
source "${NIX_PROFILE_SH}"
|
||||
return
|
||||
else
|
||||
# Setup Nix if not available
|
||||
${GIT_ROOT}/nix/scripts/setup.sh
|
||||
fi
|
||||
|
||||
# Load Nix profile
|
||||
source "${NIX_PROFILE_SH}"
|
||||
|
||||
# Verify Nix is available
|
||||
if [[ ! -x $(command -v nix) ]]; then
|
||||
echo "Nix not available, sourcing profile failed!" > /dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
source_nix_profile() {
|
||||
NIX_INSTALL_TYPE=$(nix_install_type)
|
||||
if [[ "${NIX_INSTALL_TYPE}" == "multi" ]]; then
|
||||
source "/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh"
|
||||
elif [[ "${NIX_INSTALL_TYPE}" == "single" ]]; then
|
||||
source "${HOME}/.nix-profile/etc/profile.d/nix.sh"
|
||||
elif [[ "${NIX_INSTALL_TYPE}" == "nixops" ]]; then
|
||||
echo "Sourcing profile not necessary on NixOS!" >&2
|
||||
fi
|
||||
}
|
||||
|
||||
source_nix
|
||||
main() {
|
||||
# Just stop if Nix is already available
|
||||
if [[ -x $(command -v nix) ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
# Setup Nix if not available
|
||||
if [[ ! -d /nix ]]; then
|
||||
${GIT_ROOT}/nix/scripts/setup.sh
|
||||
fi
|
||||
|
||||
# Load Nix profile
|
||||
source_nix_profile
|
||||
|
||||
# Verify Nix is available
|
||||
if [[ ! -x $(command -v nix) ]]; then
|
||||
echo -e "${RED}Nix not available, sourcing profile failed!${RST}" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
main
|
||||
|
22
package.json
22
package.json
@ -12,9 +12,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-native-community/async-storage": "^1.11.0",
|
||||
"@react-native-community/audio-toolkit": "git+https://github.com/tbenr/react-native-audio-toolkit.git#v2.0.3-status-v6",
|
||||
"@react-native-community/audio-toolkit": "git+https://github.com/tbenr/react-native-audio-toolkit.git#refs/tags/v2.0.3-status-v6",
|
||||
"@react-native-community/blur": "^3.6.0",
|
||||
"@react-native-community/cameraroll": "git+https://github.com/status-im/react-native-cameraroll.git#v4.0.4-status.0",
|
||||
"@react-native-community/cameraroll": "git+https://github.com/status-im/react-native-cameraroll.git#refs/tags/v4.0.4-status.0",
|
||||
"@react-native-community/clipboard": "^1.2.2",
|
||||
"@react-native-community/hooks": "^2.5.1",
|
||||
"@react-native-community/masked-view": "^0.1.6",
|
||||
@ -23,7 +23,7 @@
|
||||
"@react-native-community/slider": "^3.0.0",
|
||||
"@walletconnect/client": "^2.0.0-beta.23",
|
||||
"@walletconnect/client-legacy": "npm:@walletconnect/client@^1.7.1",
|
||||
"bignumber.js": "git+https://github.com/status-im/bignumber.js.git#v4.0.2-status",
|
||||
"bignumber.js": "git+https://github.com/status-im/bignumber.js.git#refs/tags/v4.0.2-status",
|
||||
"buffer": "^5.4.2",
|
||||
"chance": "^1.1.0",
|
||||
"create-react-class": "^15.6.2",
|
||||
@ -41,7 +41,7 @@
|
||||
"react-native-background-timer": "^2.1.1",
|
||||
"react-native-blob-util": "^0.13.18",
|
||||
"react-native-camera-kit": "^8.0.4",
|
||||
"react-native-config": "git+https://github.com/status-im/react-native-config.git#v1.4.2-status",
|
||||
"react-native-config": "git+https://github.com/status-im/react-native-config.git#refs/tags/v1.4.2-status",
|
||||
"react-native-device-info": "^7.4.0",
|
||||
"react-native-dialogs": "^1.0.4",
|
||||
"react-native-draggable-flatlist": "^3.0.3",
|
||||
@ -50,10 +50,10 @@
|
||||
"react-native-fs": "^2.14.1",
|
||||
"react-native-gesture-handler": "^1.8.0",
|
||||
"react-native-haptic-feedback": "^1.9.0",
|
||||
"react-native-image-crop-picker": "git+https://github.com/status-im/react-native-image-crop-picker.git#v0.36.2-status.0",
|
||||
"react-native-image-crop-picker": "git+https://github.com/status-im/react-native-image-crop-picker.git#refs/tags/v0.36.2-status.0",
|
||||
"react-native-image-resizer": "^1.2.3",
|
||||
"react-native-image-viewing": "git+https://github.com/status-im/react-native-image-viewing.git#v0.2.1.status",
|
||||
"react-native-keychain": "git+https://github.com/status-im/react-native-keychain.git#v.3.0.0-5-status",
|
||||
"react-native-image-viewing": "git+https://github.com/status-im/react-native-image-viewing.git#refs/tags/v0.2.1.status",
|
||||
"react-native-keychain": "git+https://github.com/status-im/react-native-keychain.git#refs/tags/v.3.0.0-5-status",
|
||||
"react-native-languages": "^3.0.2",
|
||||
"react-native-linear-gradient": "^2.5.6",
|
||||
"react-native-mail": "^6.1.1",
|
||||
@ -67,11 +67,11 @@
|
||||
"react-native-shake": "^3.3.1",
|
||||
"react-native-share": "^7.0.1",
|
||||
"react-native-splash-screen": "^3.2.0",
|
||||
"react-native-status-keycard": "git+https://github.com/status-im/react-native-status-keycard.git#v2.5.37",
|
||||
"react-native-status-keycard": "git+https://github.com/status-im/react-native-status-keycard.git#refs/tags/v2.5.37",
|
||||
"react-native-svg": "^9.8.4",
|
||||
"react-native-touch-id": "^4.4.1",
|
||||
"react-native-webview": "git+https://github.com/status-im/react-native-webview.git#v11.16.0-status",
|
||||
"rn-emoji-keyboard": "git+https://github.com/status-im/rn-emoji-keyboard.git#v0.4.2",
|
||||
"react-native-webview": "git+https://github.com/status-im/react-native-webview.git#refs/tags/v11.16.0-status",
|
||||
"rn-emoji-keyboard": "git+https://github.com/status-im/rn-emoji-keyboard.git#refs/tags/v0.4.2",
|
||||
"tdigest": "^0.1.1",
|
||||
"web3-utils": "^1.2.1"
|
||||
},
|
||||
@ -86,7 +86,7 @@
|
||||
"jest": "^25.1.0",
|
||||
"nyc": "^14.1.1",
|
||||
"process": "0.11.10",
|
||||
"rn-snoopy": "git+https://github.com/status-im/rn-snoopy.git#v2.0.2-status",
|
||||
"rn-snoopy": "git+https://github.com/status-im/rn-snoopy.git#refs/tags/v2.0.2-status",
|
||||
"shadow-cljs": "^2.10.14"
|
||||
}
|
||||
}
|
||||
|
22
yarn.lock
22
yarn.lock
@ -1243,7 +1243,7 @@
|
||||
dependencies:
|
||||
deep-assign "^3.0.0"
|
||||
|
||||
"@react-native-community/audio-toolkit@git+https://github.com/tbenr/react-native-audio-toolkit.git#v2.0.3-status-v6":
|
||||
"@react-native-community/audio-toolkit@git+https://github.com/tbenr/react-native-audio-toolkit.git#refs/tags/v2.0.3-status-v6":
|
||||
version "2.0.3"
|
||||
resolved "git+https://github.com/tbenr/react-native-audio-toolkit.git#7ae9055cf6169b30f5089bda7bfcfc1c40a715e5"
|
||||
dependencies:
|
||||
@ -1258,7 +1258,7 @@
|
||||
dependencies:
|
||||
prop-types "^15.5.10"
|
||||
|
||||
"@react-native-community/cameraroll@git+https://github.com/status-im/react-native-cameraroll.git#v4.0.4-status.0":
|
||||
"@react-native-community/cameraroll@git+https://github.com/status-im/react-native-cameraroll.git#refs/tags/v4.0.4-status.0":
|
||||
version "4.0.4"
|
||||
resolved "git+https://github.com/status-im/react-native-cameraroll.git#337c5a515e9b0f0728882f73568075553415f523"
|
||||
|
||||
@ -2321,7 +2321,7 @@ big-integer@^1.6.44:
|
||||
resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.48.tgz#8fd88bd1632cba4a1c8c3e3d7159f08bb95b4b9e"
|
||||
integrity sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==
|
||||
|
||||
"bignumber.js@git+https://github.com/status-im/bignumber.js.git#v4.0.2-status":
|
||||
"bignumber.js@git+https://github.com/status-im/bignumber.js.git#refs/tags/v4.0.2-status":
|
||||
version "4.0.2"
|
||||
resolved "git+https://github.com/status-im/bignumber.js.git#cc066a0a3d6bfe0c436c9957f4ea8344bf963c89"
|
||||
|
||||
@ -7326,7 +7326,7 @@ react-native-camera-kit@^8.0.4:
|
||||
dependencies:
|
||||
lodash "^4.14.2"
|
||||
|
||||
"react-native-config@git+https://github.com/status-im/react-native-config.git#v1.4.2-status":
|
||||
"react-native-config@git+https://github.com/status-im/react-native-config.git#refs/tags/v1.4.2-status":
|
||||
version "1.4.2"
|
||||
resolved "git+https://github.com/status-im/react-native-config.git#c3e58d76fed923aaf88eadc5073099fab5ecb346"
|
||||
|
||||
@ -7394,7 +7394,7 @@ react-native-haptic-feedback@^1.9.0:
|
||||
resolved "https://registry.yarnpkg.com/react-native-haptic-feedback/-/react-native-haptic-feedback-1.9.0.tgz#7d62c54536f04dd5d8f1c2bb8ee444009f2294b9"
|
||||
integrity sha512-tIRbq8k7HK9AoyvXrOHUEFmJd65ZAh1HP9mDyD/gDisG1ApY4Im9UKn0q0of9z7s8AJY3sZA9GMuSKdSBGdKKQ==
|
||||
|
||||
"react-native-image-crop-picker@git+https://github.com/status-im/react-native-image-crop-picker.git#v0.36.2-status.0":
|
||||
"react-native-image-crop-picker@git+https://github.com/status-im/react-native-image-crop-picker.git#refs/tags/v0.36.2-status.0":
|
||||
version "0.36.2"
|
||||
resolved "git+https://github.com/status-im/react-native-image-crop-picker.git#d14a68dcb643328b91e783d3a83561e7d6e0bd25"
|
||||
|
||||
@ -7403,11 +7403,11 @@ react-native-image-resizer@^1.2.3:
|
||||
resolved "https://registry.yarnpkg.com/react-native-image-resizer/-/react-native-image-resizer-1.2.3.tgz#21cb2b158ff950e55a0fc01c2cb61375bd5a03ba"
|
||||
integrity sha512-RDPNJglRmWDZ/7hvu+CbpsKYl6AQmseL8cWX4UkLAHxQWNc5ZdYhP/9avC5xCfyiwkRw+Zmkmv78HO0kt0ewhQ==
|
||||
|
||||
"react-native-image-viewing@git+https://github.com/status-im/react-native-image-viewing.git#v0.2.1.status":
|
||||
"react-native-image-viewing@git+https://github.com/status-im/react-native-image-viewing.git#refs/tags/v0.2.1.status":
|
||||
version "0.2.1"
|
||||
resolved "git+https://github.com/status-im/react-native-image-viewing.git#94af89356f2e4e08f462370c77e4778d7626ce2f"
|
||||
|
||||
"react-native-keychain@git+https://github.com/status-im/react-native-keychain.git#v.3.0.0-5-status":
|
||||
"react-native-keychain@git+https://github.com/status-im/react-native-keychain.git#refs/tags/v.3.0.0-5-status":
|
||||
version "3.0.0-rc.3"
|
||||
resolved "git+https://github.com/status-im/react-native-keychain.git#9b0d9b283116947cf125e12b6d1d17203604f0d9"
|
||||
|
||||
@ -7496,7 +7496,7 @@ react-native-splash-screen@^3.2.0:
|
||||
resolved "https://registry.yarnpkg.com/react-native-splash-screen/-/react-native-splash-screen-3.2.0.tgz#d47ec8557b1ba988ee3ea98d01463081b60fff45"
|
||||
integrity sha512-Ls9qiNZzW/OLFoI25wfjjAcrf2DZ975hn2vr6U9gyuxi2nooVbzQeFoQS5vQcbCt9QX5NY8ASEEAtlLdIa6KVg==
|
||||
|
||||
"react-native-status-keycard@git+https://github.com/status-im/react-native-status-keycard.git#v2.5.37":
|
||||
"react-native-status-keycard@git+https://github.com/status-im/react-native-status-keycard.git#refs/tags/v2.5.37":
|
||||
version "2.5.37"
|
||||
resolved "git+https://github.com/status-im/react-native-status-keycard.git#af61b0213adbf4b5a6bae97c85496d95007d5acb"
|
||||
|
||||
@ -7513,7 +7513,7 @@ react-native-touch-id@^4.4.1:
|
||||
resolved "https://registry.yarnpkg.com/react-native-touch-id/-/react-native-touch-id-4.4.1.tgz#8b1bb2d04c30bac36bb9696d2d723e719c4a8b08"
|
||||
integrity sha512-1jTl8fC+0fxvqegy/XXTyo6vMvPhjzkoDdaqoYZx0OH8AT250NuXnNPyKktvigIcys3+2acciqOeaCall7lrvg==
|
||||
|
||||
"react-native-webview@git+https://github.com/status-im/react-native-webview.git#v11.16.0-status":
|
||||
"react-native-webview@git+https://github.com/status-im/react-native-webview.git#refs/tags/v11.16.0-status":
|
||||
version "11.16.0"
|
||||
resolved "git+https://github.com/status-im/react-native-webview.git#9d554dd25b33d799c37eb356c0dfa42ca8bd4ff7"
|
||||
dependencies:
|
||||
@ -7860,11 +7860,11 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
|
||||
hash-base "^3.0.0"
|
||||
inherits "^2.0.1"
|
||||
|
||||
"rn-emoji-keyboard@git+https://github.com/status-im/rn-emoji-keyboard.git#v0.4.2":
|
||||
"rn-emoji-keyboard@git+https://github.com/status-im/rn-emoji-keyboard.git#refs/tags/v0.4.2":
|
||||
version "0.4.2"
|
||||
resolved "git+https://github.com/status-im/rn-emoji-keyboard.git#969814269cc51fae2c1fd0375e8509fa066cdc7f"
|
||||
|
||||
"rn-snoopy@git+https://github.com/status-im/rn-snoopy.git#v2.0.2-status":
|
||||
"rn-snoopy@git+https://github.com/status-im/rn-snoopy.git#refs/tags/v2.0.2-status":
|
||||
version "2.0.2"
|
||||
resolved "git+https://github.com/status-im/rn-snoopy.git#f23dc13469c6c2a694649f658cdc1d1eaf8def64"
|
||||
dependencies:
|
||||
|
Loading…
x
Reference in New Issue
Block a user