citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

commit b39d56a4c741598c3c1c7fce56755c7af17212d9
parent c7b2641c8b205c2ae3d803e36681aa673d83c6f6
Author: William Casarin <jb55@jb55.com>
Date:   Sun, 21 Nov 2021 13:33:24 -0800

monad dotfiles changes

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mdotfiles/.bash_aliases | 269-------------------------------------------------------------------------------
Mdotfiles/.bashrc | 270+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
Mdotfiles/.config/neomutt/neomuttrc | 2+-
Mdotfiles/.config/nvim/init.vim | 3+--
Mdotfiles/.config/qutebrowser/autoconfig.yml | 2+-
Mdotfiles/.config/qutebrowser/quickmarks | 1+
Adotfiles/.local/share/zathura/history | 2++
Mdotfiles/commands | 1+
Adotfiles/madonctl.yaml | 0
Adotfiles/skeletons/nix-rust/.rustfmt.toml | 1+
10 files changed, 274 insertions(+), 277 deletions(-)

diff --git a/dotfiles/.bash_aliases b/dotfiles/.bash_aliases @@ -3,272 +3,3 @@ # generic stuff for non-interactive shells # sharefile -export PAGER="less" -export LESS="-cix8RM --save-marks" - -# mesa -export RADV_PERFTEST=aco -export AMD_DEBUG=nodma - -TERM_THEME="$(basename $(readlink ~/.Xresources.d/themes/current))" - -if [ "$TERM_THEME" == "light" ] -then - export BAT_THEME=GitHub -else - export BAT_THEME=base16 -fi - -export PANDOC=pandoc-nice -export BAT_STYLE=plain -export LPASS_HOME="$HOME/.config/lpass" -export FUZZER=fzf -export GOPHERCLIENT=vf1 -export GEMINICLIENT=av98 -export GOPHER=$GOPHERCLIENT -export GNUPGHOME="$HOME/.gnupg" -export SHAREFILE_HOST='charon:public/s/' -export KINDLE_FROM_EMAIL='jackbox55@gmail.com' -export KINDLE_TXT_EMAIL='jb55@jb55.com' -export KINDLE_EMAIL='jb55@free.kindle.com' -export SHAREFILE_URL='https://jb55.com/s/' -export SHARE_SS_DIR="$HOME/var/img/ss" -export DOTFILES=${DOTFILES:-$HOME/dotfiles} -export VI_MODE=1 -export XZ=pxz -export HISTSIZE=50000 -export FZF_CTRL_R_OPTS="-e" -export FZF_DEFAULT_OPTS="-e" -export FZF_DEFAULT_COMMAND='rg --files --hidden' -export EMACSCLIENT=edit - -export NIXPKGS=$HOME/nixpkgs - -# nix paths -export NIX_PATH="nixpkgs=$NIXPKGS:$NIX_PATH" -export NIX_PATH="nixos-config=$NIX_FILES:$NIX_PATH" -export NIX_PATH="jb55pkgs=$HOME/etc/jb55pkgs:$NIX_PATH" -export NIX_PATH="dotfiles=$HOME/dotfiles:$NIX_PATH" - -# Customize to your needs... - -# other -export EDITOR="edit" -export VISUAL="edit" -export BROWSER="browser" -export PAGER=less - -# go - -export GOPATH=$HOME/dev/gocode -export PATH=$HOME/bin:$PATH -export PATH=$HOME/.local/bin:$PATH -export PATH=$HOME/.npm/bin:$PATH - -md () { - mandown README* -} - -function run_fuzzer() { - eval "$(fuzz-run-command "$@")" -} - -alias C="pcal list" -alias Ci="pcal interactive" -alias m="neomutt" -alias mq="msmtp-queue" -alias s="general-status" -alias t="todo.sh" -alias e="edit -n" -alias g=git -alias f=run_fuzzer -alias vim=nvim -alias feh="feh --conversion-timeout 2" -alias info="info --vi-keys" -alias ag="ag --pager=less" -alias attach="grabssh; screen -rD" -alias awkt="awk -v FS=$'\t' -v OFS=$'\t'" -alias catt="pygmentize -O style=monokai -f console256 -g" -alias clip="xclip -selection clipboard" -alias cpptags="ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++" -alias crontab="VIM_CRONTAB=true crontab" -alias cutt="cut -d $'\t' --output-delimiter=$'\t'" -alias emacs="env TERM=xterm-256color emacs" -alias fixssh="source $HOME/bin/fixssh" -alias githist="git reflog show | grep '}: commit' | nl | sort -nr | nl | sort -nr | cut --fields=1,3 | sed s/commit://g | sed -e 's/HEAD*@{[0-9]*}://g'" -alias jsonpp="python -mjson.tool" -alias ls="ls --color" -alias noder="env NODE_NO_READLINE=1 rlwrap node" -alias nr="npm run" -alias page=$PAGER -alias prettyjson=jsonpp -alias sorry='sudo $(fc -l -n -1)' -alias tmuxa="tmux a -d -t " -alias tmux="tmux -2" -alias vless="/usr/share/vim/vim72/macros/less.sh" -alias vnc_once="x11vnc -safer -nopw -once -display :0" -alias wget="wget -c" -alias xclip="xclip -selection clipboard" -alias myip="dig +short myip.opendns.com @resolver1.opendns.com" -alias wanip=myip -alias myipaddress=myip -alias ns="nix-shell -p" -alias fzf="fzf --exact" -alias u="cd .." -alias scs="systemctl status" -alias scsu="systemctl status --user" -alias jc="journalctl -u" -alias jcu="journalctl --user -u" - -ghclone () { - cd "$(gh-clone "$@")" -} - -srhtclone () { - cd "$(srht-clone "$@")" -} - -cdnp () { - nix-build '<nixpkgs>' --no-out-link -A "$1" - cd $(nix-path "$1") -} - -np () { - nix-path "$1" -} - -nsr () { - local cmd="$1" - shift - nix-shell -p "$cmd" --run "$@" -} - -nsr2 () { - local cmd="$1" - shift - local cmd2="$(<<<"$cmd" rev | cut -d. -f1 | rev) $@" - nsr "$cmd" "$cmd2" -} - -nsc () { - local cmd="$1" - shift - nix-shell -p "$cmd" --command "$@" -} - -share () { - sharefile "$@" | xclip -} - -sharess () { - share_last_ss | xclip -} - -lt () { - ls -ltah "$@" | "$PAGER" -} - -lt1 () { - res=$(\ls -1 -t "$@" | head -n1) - xclip <<<"$res" - printf '%s\n' "$res" -} - -mv1 () { - mv $(lt1 | stripansi) "$@" -} - -pcsv () { - csv-delim "$@" | pcsvt -} - -pcsvt () { - columnt "$@" | cat -n | less -R -S -} - -header() { - headers "${2:-/dev/stdin}" | grep "$1" | cutt -f1 | sed -E 's,^[ ]*,,g' -} - -nsum() { - awkt '{total = total + $1}END{print total}' -} - -sumcol() { - cut -f "$1" | nsum -} - -uniqc() { - sort "$@" | uniq -c | sort -nr -} - -cdl () { - cd "$(dirname "$(readlink -f "$(which "$1")")")" -} - -env-type () { - envtype="$1" - shift - nix-shell -Q -p $envtype "$@" -} - -haskell-env () { - env-type "haskellEnv" "$@" -} - -haskell-env-hoogle () { - env-type "haskellEnvHoogle" "$@" -} - -haskell-env-tools() { - env-type "haskellTools" "$@" -} - -build-nix-cache() { - nix-env -f "$NIXPKGS" -qaP \* > ~/.nixenv.cache -} - -haskell-shell() { - nix-shell -p "haskellPackages.ghcWithPackages (pkgs: with pkgs; [$*])" -} - -nix-path() { - nix-instantiate --eval --expr 'with import <nixpkgs> {}; "${'"$1"'}"' | sed 's/"//g' -} - -vnc-once() { - x11vnc -safer -nopw -once -display ':0' "$1" -} - -sql_wineparty() { - export CS='postgres://wineparty.xyz/wineparty' - export PG_USER='jb55' -} - -sql_() { - local query="$1" - local args=("-U" "$pg_user" -A) - if [ ! -z "$query" ]; - then - args+=(-c "$query") - fi - psql -F $'\t' "${args[@]}" -} - -sql() { - sql_ "$@" -t | pcsvt -} - -# fzf -source $DOTFILES/.fzf_helpers - -# z -source $HOME/bin/z.sh - -# private stuff -source $HOME/.bash_private - -# nix -#. /Users/jb55/.nix-profile/etc/profile.d/nix.sh - -CURL_CA_BUNDLE=/opt/local/share/curl/curl-ca-bundle.crt diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc @@ -3,8 +3,10 @@ # for examples set -o vi +export HOME=/home/jb55 + # If not running interactively, don't do anything -[ -z "$PS1" ] && return +#[ -z "$PS1" ] && return export LONG_RUNNING_COMMAND_TIMEOUT=3 export PS1='$(printf "\x01\033[30;1m\x02%3.*s\x01\033[0m\x02> \x01\033[33m\x02" $? $?)' @@ -24,15 +26,275 @@ shopt -s checkwinsize DIRCOLORS="$HOME/.dircolors" UNDISTRACT="$HOME/dotfiles/bash-undistract-me/undistract-me.sh" -bind +export PAGER="less" +export LESS="-cix8RM --save-marks" + +TERM_THEME="$(basename $(readlink ~/.Xresources.d/themes/current))" + +if [ "$TERM_THEME" == "light" ] +then + export BAT_THEME=GitHub +else + export BAT_THEME=zenburn +fi + +export NNCPCFG=~/.nncprc +export PANDOC=pandoc-nice +export BAT_STYLE=plain +export LPASS_HOME="$HOME/.config/lpass" +export FUZZER=fzf +export GOPHERCLIENT=vf1 +export GEMINICLIENT=av98 +export GOPHER=$GOPHERCLIENT +export GNUPGHOME="$HOME/.gnupg" +export SHAREFILE_HOST='charon:public/s/' +export KINDLE_FROM_EMAIL='jackbox55@gmail.com' +export KINDLE_TXT_EMAIL='jb55@jb55.com' +export KINDLE_EMAIL='jb55@free.kindle.com' +export SHAREFILE_URL='https://jb55.com/s/' +export SHARE_SS_DIR="$HOME/var/img/ss" +export DOTFILES=${DOTFILES:-$HOME/dotfiles} +export VI_MODE=1 +export XZ=pxz +export HISTSIZE=50000 +export FZF_CTRL_R_OPTS="-e" +export FZF_DEFAULT_OPTS="-e" +export FZF_DEFAULT_COMMAND='rg --files --hidden' +export EMACSCLIENT=edit + +export NIXPKGS=$HOME/nixpkgs + +# nix paths +export NIX_PATH="nixpkgs=$NIXPKGS:$NIX_PATH" +export NIX_PATH="nixos-config=$NIX_FILES:$NIX_PATH" +export NIX_PATH="jb55pkgs=$HOME/etc/jb55pkgs:$NIX_PATH" +export NIX_PATH="dotfiles=$HOME/dotfiles:$NIX_PATH" + +# Customize to your needs... + +# other +export EDITOR="edit" +export VISUAL="edit" +export BROWSER="browser" +export PAGER=less + +# go + +export GOPATH=$HOME/dev/gocode +export PATH=$HOME/bin:$PATH +export PATH=$HOME/.local/bin:$PATH +export PATH=$HOME/.npm/bin:$PATH + +md () { + mandown README* +} + +function run_fuzzer() { + eval "$(fuzz-run-command "$@")" +} + +alias C="pcal list" +alias Ci="pcal interactive" +alias m="neomutt" +alias mq="msmtp-queue" +alias s="general-status" +alias t="todo.sh" +alias e="edit -n" +alias g=git +alias f=run_fuzzer +alias vim=nvim +alias feh="feh --conversion-timeout 2" +alias info="info --vi-keys" +alias ag="ag --pager=less" +alias attach="grabssh; screen -rD" +alias awkt="awk -v FS=$'\t' -v OFS=$'\t'" +alias catt="pygmentize -O style=monokai -f console256 -g" +alias clip="xclip -selection clipboard" +alias cpptags="ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++" +alias crontab="VIM_CRONTAB=true crontab" +alias cutt="cut -d $'\t' --output-delimiter=$'\t'" +alias emacs="env TERM=xterm-256color emacs" +alias fixssh="source $HOME/bin/fixssh" +alias githist="git reflog show | grep '}: commit' | nl | sort -nr | nl | sort -nr | cut --fields=1,3 | sed s/commit://g | sed -e 's/HEAD*@{[0-9]*}://g'" +alias jsonpp="python -mjson.tool" +alias ls="ls --color" +alias noder="env NODE_NO_READLINE=1 rlwrap node" +alias nr="npm run" +alias page=$PAGER +alias prettyjson=jsonpp +alias sorry='sudo $(fc -l -n -1)' +alias tmuxa="tmux a -d -t " +alias tmux="tmux -2" +alias vless="/usr/share/vim/vim72/macros/less.sh" +alias vnc_once="x11vnc -safer -nopw -once -display :0" +alias wget="wget -c" +alias xclip="xclip -selection clipboard" +alias myip="dig +short myip.opendns.com @resolver1.opendns.com" +alias wanip=myip +alias myipaddress=myip +alias ns="nix-shell -p" +alias fzf="fzf --exact" +alias u="cd .." +alias scs="systemctl status" +alias scsu="systemctl status --user" +alias jc="journalctl -u" +alias jcu="journalctl --user -u" + +ghclone () { + cd "$(gh-clone "$@")" +} + +srhtclone () { + cd "$(srht-clone "$@")" +} + +cdnp () { + nix-build '<nixpkgs>' --no-out-link -A "$1" + cd $(nix-path "$1") +} + +np () { + nix-path "$1" +} + +nsr () { + local cmd="$1" + shift + nix-shell -p "$cmd" --run "$@" +} + +nsr2 () { + local cmd="$1" + shift + local cmd2="$(<<<"$cmd" rev | cut -d. -f1 | rev) $@" + nsr "$cmd" "$cmd2" +} + +nsc () { + local cmd="$1" + shift + nix-shell -p "$cmd" --command "$@" +} + +share () { + sharefile "$@" | xclip +} + +sharess () { + share_last_ss | xclip +} + +lt () { + ls -ltah "$@" | "$PAGER" +} + +lt1 () { + res=$(\ls -1 -t "$@" | head -n1) + xclip <<<"$res" + printf '%s\n' "$res" +} + +mv1 () { + mv $(lt1 | stripansi) "$@" +} + +pcsv () { + csv-delim "$@" | pcsvt +} + +pcsvt () { + columnt "$@" | cat -n | less -R -S +} + +header() { + headers "${2:-/dev/stdin}" | grep "$1" | cutt -f1 | sed -E 's,^[ ]*,,g' +} + +nsum() { + awkt '{total = total + $1}END{print total}' +} + +sumcol() { + cut -f "$1" | nsum +} + +uniqc() { + sort "$@" | uniq -c | sort -nr +} + +cdl () { + cd "$(dirname "$(readlink -f "$(which "$1")")")" +} + +env-type () { + envtype="$1" + shift + nix-shell -Q -p $envtype "$@" +} + +haskell-env () { + env-type "haskellEnv" "$@" +} + +haskell-env-hoogle () { + env-type "haskellEnvHoogle" "$@" +} + +haskell-env-tools() { + env-type "haskellTools" "$@" +} + +build-nix-cache() { + nix-env -f "$NIXPKGS" -qaP \* > ~/.nixenv.cache +} + +haskell-shell() { + nix-shell -p "haskellPackages.ghcWithPackages (pkgs: with pkgs; [$*])" +} + +nix-path() { + nix-instantiate --eval --expr 'with import <nixpkgs> {}; "${'"$1"'}"' | sed 's/"//g' +} + +vnc-once() { + x11vnc -safer -nopw -once -display ':0' "$1" +} + +sql_wineparty() { + export CS='postgres://wineparty.xyz/wineparty' + export PG_USER='jb55' +} + +sql_() { + local query="$1" + local args=("-U" "$pg_user" -A) + if [ ! -z "$query" ]; + then + args+=(-c "$query") + fi + psql -F $'\t' "${args[@]}" +} + +sql() { + sql_ "$@" -t | pcsvt +} + +# fzf +source $DOTFILES/.fzf_helpers + +# z +source $HOME/bin/z.sh + +# nix +#. /Users/jb55/.nix-profile/etc/profile.d/nix.sh -[ -f ~/.bash_aliases ] && source ~/.bash_aliases +CURL_CA_BUNDLE=/opt/local/share/curl/curl-ca-bundle.crt [ -e "$DIRCOLORS" ] && eval "$(dircolors -b "$DIRCOLORS")" [ -f ~/.fzf.bash ] && source ~/.fzf.bash [ -f ~/bin/z.sh ] && source ~/bin/z.sh [ -f "$UNDISTRACT" ] && source "$UNDISTRACT" -eval "$(direnv hook bash)" +eval "$(/run/current-system/sw/bin/direnv hook bash)" # needed for the C-h binding bind '"\C-x\C-a": vi-movement-mode' diff --git a/dotfiles/.config/neomutt/neomuttrc b/dotfiles/.config/neomutt/neomuttrc @@ -33,7 +33,7 @@ macro index,pager a "<modify-labels>-unread -inbox<enter>j<enter> macro index,pager A "<create-alias>" "Create alias" macro index,pager F "<modify-labels>+filed" "File message" macro index,pager + "<modify-labels>+" -macro index S "<modify-labels>+spam -unread -inbox" "Spam message" +macro index,pager S "<modify-labels>+spam -unread -inbox<enter>j<enter> macro index c "<change-vfolder>?" "Change to vfolder overview" macro index \\\\ "<vfolder-from-query>" "Search mailbox" macro pager p "|delta --paging always<enter>" diff --git a/dotfiles/.config/nvim/init.vim b/dotfiles/.config/nvim/init.vim @@ -22,8 +22,7 @@ nmap <C-x> :x<CR> autocmd FileType go autocmd BufWritePre <buffer> execute "normal! mz:mkview\<esc>:%!fmtsafe gofmt\<esc>:loadview\<esc>`z" autocmd FileType rust autocmd BufWritePre <buffer> execute "normal! mz:mkview\<esc>:%!fmtsafe rustfmt\<esc>:loadview\<esc>`z" -autocmd filetype javascript set sw=2 ts=2 expandtab +autocmd filetype javascript set sw=4 ts=4 expandtab -autocmd filetype javascript set sw=2 ts=2 expandtab autocmd BufEnter,BufNew *.gmi set wrap linebreak au BufWritePost,FileWritePost ~/.Xdefaults,~/.Xresources silent! !xrdb -load % >/dev/null 2>&1 diff --git a/dotfiles/.config/qutebrowser/autoconfig.yml b/dotfiles/.config/qutebrowser/autoconfig.yml @@ -6,5 +6,5 @@ config_version: 2 settings: - content.host_blocking.enabled: + content.blocking.enabled: global: false diff --git a/dotfiles/.config/qutebrowser/quickmarks b/dotfiles/.config/qutebrowser/quickmarks @@ -25,3 +25,4 @@ rbc https://www.rbcroyalbank.com/personal.html zlibrary https://ca1lib.org/ scihub https://sci-hub.se/ twitter https://tweetdeck.twitter.com/ +wasm-instantiation https://webassembly.github.io/spec/core/exec/modules.html#exec-instantiation diff --git a/dotfiles/.local/share/zathura/history b/dotfiles/.local/share/zathura/history @@ -0,0 +1 @@ +/home/jb55/docs/history+ \ No newline at end of file diff --git a/dotfiles/commands b/dotfiles/commands @@ -7,6 +7,7 @@ cr compile repeat fuzz-compile-repeat cs compile show build echo cat .build-result ecc edit vdirsyncer config echo edit ~/.config/vdirsyncer/config ec edit commands fuzz-edit-scripts +ed edit default.nix echo edit default.nix eFc edit fuzz command fuzz-edit-command eFl edit fuzz command list fuzz-edit-command-list egc edit git config echo edit ~/.gitconfig diff --git a/dotfiles/madonctl.yaml b/dotfiles/madonctl.yaml diff --git a/dotfiles/skeletons/nix-rust/.rustfmt.toml b/dotfiles/skeletons/nix-rust/.rustfmt.toml @@ -0,0 +1 @@ +edition = "2018"