diff options
-rwxr-xr-x | zscripts/nicegit.zsh | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | zscripts/nixshell.zsh | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/zscripts/nicegit.zsh b/zscripts/nicegit.zsh index 276d98e..e422fb0 100755 --- a/zscripts/nicegit.zsh +++ b/zscripts/nicegit.zsh @@ -19,7 +19,7 @@ function gc() { else echo "Enter commit message:" && read commit fi - git commit -m "$commit" + git commit -m "$commit" } function __is_diff() { diff --git a/zscripts/nixshell.zsh b/zscripts/nixshell.zsh index dfc884a..16d0ee3 100644..100755 --- a/zscripts/nixshell.zsh +++ b/zscripts/nixshell.zsh @@ -10,3 +10,15 @@ if [ -n "$IN_NIX_SHELL" ]; then # 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} +} |