Created
July 9, 2020 14:19
-
-
Save rummik/acd1bf7ddc958f4951c7fd6c78832cdf to your computer and use it in GitHub Desktop.
ZSH Python venv shell.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
with pkgs; | |
mkShell { | |
name = "python-env"; | |
buildInputs = [ | |
python3 | |
]; | |
zshinithook = writeScript "zsh-init-hook.zsh" /* zsh */ '' | |
export VIRTUAL_ENV_DISABLE_PROMPT=1 | |
python -m venv .venv | |
source .venv/bin/activate | |
exec 0</dev/tty | |
exec 1>/dev/tty | |
exec 2>/dev/tty | |
setopt zle | |
''; | |
shellHook = /* sh */ '' | |
exec zsh \ | |
--interactive \ | |
--hist-ignore-space \ | |
--stdin &>/dev/null <<< " source $zshinithook" | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment