#!@zsh@/bin/zsh set -e gcrootsDir=${PWD}/.nix-gc-roots if [[ ${#@} -ge 1 ]]; then shellFile=${1} shift else shellFile=${PWD}/shell.nix fi set -x mkdir -p ${gcrootsDir} nix-instantiate ${shellFile} --indirect --add-root ${gcrootsDir}/shell.drv nix-store --indirect --add-root ${gcrootsDir}/shell.dep --realise $(nix-store --query --references ${gcrootsDir}/shell.drv) set +x exec nix-shell $(readlink ${gcrootsDir}/shell.drv) ${@}