#!/usr/bin/env zsh # Make nix shell run zsh alias nix-shell="nix-shell --command zsh" if [ -n "$IN_NIX_SHELL" ]; then # Export shell as zsh instead of bash export SHELL=zsh # Add nix-shell prefix to prompt in the same style as python venv PS1PREFIX="(nix-shell) " fi # Read requirements.txt in to nix-shell function nix-shell-py() { if [ ! -f ./requirements.txt ]; then echo "No requirements.txt file was found in the current directory. Exiting..." 1>&2 exit 1 fi requirements="$(sed 's/#.*//;s/^/python3Packages./' ./requirements.txt | tr -s '\n' ' ')" nix-shell -p ${=requirements} }