aboutsummaryrefslogtreecommitdiff
path: root/config/zsh/aliases/dev.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'config/zsh/aliases/dev.zsh')
-rw-r--r--config/zsh/aliases/dev.zsh25
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))'"
+