diff options
| author | Akshay Nair <phenax5@gmail.com> | 2022-03-03 23:09:03 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2022-03-03 23:09:03 +0530 |
| commit | e160c24728bad4076f148b0a31de92f88df365d8 (patch) | |
| tree | 3c8c2e9e75f189ba34f6e140319a74f511bf5c81 /config/zsh/aliases/dev.zsh | |
| parent | bba9d09328c19d948914628666925510ee6abf88 (diff) | |
| download | nixos-config-e160c24728bad4076f148b0a31de92f88df365d8.tar.gz nixos-config-e160c24728bad4076f148b0a31de92f88df365d8.zip | |
config sync
Diffstat (limited to 'config/zsh/aliases/dev.zsh')
| -rw-r--r-- | config/zsh/aliases/dev.zsh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/config/zsh/aliases/dev.zsh b/config/zsh/aliases/dev.zsh index 6a9d8f3..4b6108b 100644 --- a/config/zsh/aliases/dev.zsh +++ b/config/zsh/aliases/dev.zsh @@ -73,3 +73,28 @@ p__load_nix_shell_file() { zle -N p__load_nix_shell_file; bindkey '^N' p__load_nix_shell_file; + + +# Enter shell +p__enter_nixshell() { + if [[ -f "./default.nix" ]] || [[ -f "./shell.nix" ]]; then + shell="nix-zsh" + if [[ -f "./shell.nix" ]]; then + shell="nix-zsh ./shell.nix" + fi + $shell + zle send-break + return 0; + else + echo ""; + echo "ERR: default.nix already exists in directory"; + zle send-break; + return 1; + fi; +} + +zle -N p__enter_nixshell; +bindkey '^X' p__enter_nixshell; + +alias fix-interpreter="nix-shell -p patchelf --run 'patchelf --set-interpreter \$(patchelf --print-interpreter \$(which mkdir))'" + |
