add NIX_KEEP to add --keep to pyre nix shell
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
cdae3423bc
commit
0e7f73fd11
10
nix/shell.sh
10
nix/shell.sh
|
@ -32,11 +32,17 @@ if command -v "nix" >/dev/null 2>&1; then
|
||||||
exec nix-shell --show-trace --argstr target-os ${TARGET_OS}
|
exec nix-shell --show-trace --argstr target-os ${TARGET_OS}
|
||||||
else
|
else
|
||||||
is_pure=''
|
is_pure=''
|
||||||
if [ "${TARGET_OS}" != 'all' ] && [ "${TARGET_OS}" != 'ios' ] && [ "${TARGET_OS}" != 'windows' ]; then
|
if [[ "${TARGET_OS}" != 'all' ]] && [[ "${TARGET_OS}" != 'ios' ]] && [[ "${TARGET_OS}" != 'windows' ]]; then
|
||||||
is_pure='--pure'
|
is_pure='--pure'
|
||||||
pure_desc='pure '
|
pure_desc='pure '
|
||||||
fi
|
fi
|
||||||
|
# This variable allows specifying which env vars to keep for Nix pure shell
|
||||||
|
# The separator is a semicolon
|
||||||
|
keep_opts=''
|
||||||
|
if [[ -n "${NIX_KEEP}" ]]; then
|
||||||
|
keep_opts="--keep ${NIX_KEEP//;/ --keep }"
|
||||||
|
fi
|
||||||
echo -e "${GREEN}Configuring ${pure_desc}Nix shell for target '${TARGET_OS}'...${NC}"
|
echo -e "${GREEN}Configuring ${pure_desc}Nix shell for target '${TARGET_OS}'...${NC}"
|
||||||
exec nix-shell ${is_pure} --show-trace --argstr target-os ${TARGET_OS} --run "$@"
|
exec nix-shell ${is_pure} ${keep_opts} --show-trace --argstr target-os ${TARGET_OS} --run "$@"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue