From 91a7852e15de0f5fd8f9cc53de456dea4f9235c1 Mon Sep 17 00:00:00 2001 From: Marco Thomas Date: Tue, 28 Nov 2023 11:24:58 +0100 Subject: [PATCH] feat(shell): add podman aliases and nix_env to PS1 --- files/shell/.bashrc | 10 ++++++++-- files/shell/.shellrc.alias | 11 ++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/files/shell/.bashrc b/files/shell/.bashrc index 03af40d..da7d4b0 100644 --- a/files/shell/.bashrc +++ b/files/shell/.bashrc @@ -16,15 +16,21 @@ git_branch() { fi } +nix_env() { + if $(echo $PATH | grep "/nix/store" > /dev/null 2>&1); then + echo "(nix)" + fi +} + HOST="\[\033[0;33m\]\h\[\033[m\]" -GIT="\[\033[0;31m\]\$(git_branch)\[\033[m\]" +GIT_NIX="\[\033[0;31m\]\$(git_branch)\$(nix_env)\[\033[m\]" DIR="\[\033[0;34m\]\w\[\033[m\]" NEWLINE=$'\n' PROMPT_COMMAND=__prompt_command __prompt_command() { local EXIT="$?" - export PS1="${HOST} ${DIR} ${GIT}${NEWLINE}" + export PS1="${HOST} ${DIR} ${GIT_NIX}${NEWLINE}" local red_lambda='\[\033[0;31m\]󱞩\[\033[00m\] ' local green_lambda='\[\033[0;32m\]󱞩\[\033[00m\] ' diff --git a/files/shell/.shellrc.alias b/files/shell/.shellrc.alias index e5431ff..fe21bfe 100644 --- a/files/shell/.shellrc.alias +++ b/files/shell/.shellrc.alias @@ -51,11 +51,16 @@ alias rm='rm -i' alias t='tmux a || tmux -u' alias tw='typst watch' +# podman +alias pm="podman" +alias pmc="podman compose" +alias pmvol='cd ~/.local/share/containers/storage/volumes' + # commands with pre-selected flags -alias mktex="latexmk -xelatex -shell-escape" +alias nd="nix develop ." alias nssh='SSH_AUTH_SOCK= ssh' -alias texmk="latexmk -xelatex -shell-escape" -alias texsh='nix-shell ~/.dots/tex.nix' +alias dhs='du . -hs' +alias dh1='du . -h -d1' # nmcli alias con='nmcli con'