Merge pull request #81 from bbigras/patch-1

don't override experimental-features
This commit is contained in:
Jörg Thalheim 2021-05-08 16:05:28 +01:00 committed by GitHub
commit 69f714f91b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,7 +79,7 @@ use_flake() {
[[ -d "$layout_dir" ]] || mkdir -p "$layout_dir" [[ -d "$layout_dir" ]] || mkdir -p "$layout_dir"
local tmp_profile_rc local tmp_profile_rc
tmp_profile_rc=$("${NIX_BIN_PREFIX}nix" print-dev-env \ tmp_profile_rc=$("${NIX_BIN_PREFIX}nix" print-dev-env \
--experimental-features "nix-command flakes" \ --extra-experimental-features "nix-command flakes" \
--profile "$tmp_profile") --profile "$tmp_profile")
# macos does not have realpath # macos does not have realpath
if command -v realpath >/dev/null; then if command -v realpath >/dev/null; then
@ -96,7 +96,7 @@ use_flake() {
rm -rf "$flake_inputs" rm -rf "$flake_inputs"
mkdir "$flake_inputs" mkdir "$flake_inputs"
flake_input_paths=$("${NIX_BIN_PREFIX}nix" flake archive --json \ flake_input_paths=$("${NIX_BIN_PREFIX}nix" flake archive --json \
--experimental-features "nix-command flakes" \ --extra-experimental-features "nix-command flakes" \
| grep -E -o '/nix/store/[^"]+') | grep -E -o '/nix/store/[^"]+')
for path in $flake_input_paths; do for path in $flake_input_paths; do
_nix_add_gcroot "$path" "${flake_inputs}/${path##*/}" _nix_add_gcroot "$path" "${flake_inputs}/${path##*/}"
@ -150,8 +150,8 @@ use_nix() {
path=$("${NIX_BIN_PREFIX}nix-instantiate" --find-file nixpkgs) path=$("${NIX_BIN_PREFIX}nix-instantiate" --find-file nixpkgs)
layout_dir=$(direnv_layout_dir) layout_dir=$(direnv_layout_dir)
local experimental_flags=() local experimental_flags=()
if "${NIX_BIN_PREFIX}nix-shell" --experimental-features '' --version 2>/dev/null >&2; then if "${NIX_BIN_PREFIX}nix-shell" --extra-experimental-features '' --version 2>/dev/null >&2; then
experimental_flags+=('--experimental-features' 'nix-command flakes') experimental_flags+=('--extra-experimental-features' 'nix-command flakes')
fi fi
if [[ "${direnv:-}" == "" ]]; then if [[ "${direnv:-}" == "" ]]; then