From 9b4721c7b1aff18888977e6718e7a1319b872c13 Mon Sep 17 00:00:00 2001 From: Andrew Coleman Date: Tue, 21 Mar 2023 14:17:23 -0400 Subject: [PATCH] initial commit --- .zshrc | 69 ++++++++++++++++++++++++ setup-mac.sh | 148 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 217 insertions(+) create mode 100644 .zshrc create mode 100755 setup-mac.sh diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..7f9e55a --- /dev/null +++ b/.zshrc @@ -0,0 +1,69 @@ +if [ -e "$HOME/.nix-profile/etc/profile.d/nix.sh" ]; then + . "$HOME/.nix-profile/etc/profile.d/nix.sh" +fi + +# shellcheck disable=2148,SC2168,SC1090,SC2125 +local FOUND_ATUIN=$+commands[atuin] + +if [[ $FOUND_ATUIN -eq 1 ]]; then + source <(atuin init zsh) +fi + +if command -v starship > /dev/null ; then + source <(starship init zsh) +fi + +if command -v direnv > /dev/null ; then + source <(direnv hook zsh) +fi + +if command -v zoxide > /dev/null ; then + source <(zoxide init zsh) + alias z="$(which zoxide)" +fi + +export BAT_THEME="Solarized (light)" +export MANPAGER="sh -c 'col -bx | bat -l man -p'" + +LESS="-R"; export LESS +PAGER=less; export PAGER +DELTA_PAGER=less; export DELTA_PAGER + +# disable ^S and ^Q control flow +stty -ixon + +EDITOR=vi +if command -v hx > /dev/null ; then + EDITOR=hx +elif command -v vim > /dev/null ; then + EDITOR=vim +fi +export EDITOR + +# Use ~~ as the trigger sequence instead of the default ** +export FZF_COMPLETION_TRIGGER='~~' + +# Options to fzf command +export FZF_COMPLETION_OPTS='--border --info=inline' +export FZF_DEFAULT_COMMAND='fd --type f --strip-cwd-prefix' + +export LS_COLORS="su=0:ca=0:*~=0;38;2;102;102;102:mh=0:do=0;38;2;0;0;0;48;2;255;106;193:pi=0;38;2;0;0;0;48;2;64;120;242:tw=0:sg=0:ln=0;38;2;255;106;193:ex=1;38;2;228;86;73:ow=0:mi=0;38;2;0;0;0;48;2;228;86;73:cd=0;38;2;255;106;193;48;2;51;51;51:rs=0:fi=0:bd=0;38;2;1;132;188;48;2;51;51;51:st=0:or=0;38;2;0;0;0;48;2;228;86;73:no=0:di=0;38;2;64;120;242:so=0;38;2;0;0;0;48;2;255;106;193:*.d=0;38;2;80;161;79:*.r=0;38;2;80;161;79:*.p=0;38;2;80;161;79:*.a=1;38;2;228;86;73:*.z=4;38;2;1;132;188:*.c=0;38;2;80;161;79:*.h=0;38;2;80;161;79:*.m=0;38;2;80;161;79:*.t=0;38;2;80;161;79:*.o=0;38;2;102;102;102:*.ex=0;38;2;80;161;79:*.nb=0;38;2;80;161;79:*.td=0;38;2;80;161;79:*.wv=0;38;2;255;106;193:*.ui=0;38;2;193;132;1:*.el=0;38;2;80;161;79:*.md=0;38;2;193;132;1:*.cr=0;38;2;80;161;79:*.mn=0;38;2;80;161;79:*.pm=0;38;2;80;161;79:*.ts=0;38;2;80;161;79:*css=0;38;2;80;161;79:*.di=0;38;2;80;161;79:*.go=0;38;2;80;161;79:*.fs=0;38;2;80;161;79:*.vb=0;38;2;80;161;79:*.rb=0;38;2;80;161;79:*.js=0;38;2;80;161;79:*.ps=0;38;2;228;86;73:*.lo=0;38;2;102;102;102:*.gz=4;38;2;1;132;188:*.py=0;38;2;80;161;79:*.hh=0;38;2;80;161;79:*.7z=4;38;2;1;132;188:*.cp=0;38;2;80;161;79:*.ml=0;38;2;80;161;79:*.kt=0;38;2;80;161;79:*.bz=4;38;2;1;132;188:*.la=0;38;2;102;102;102:*.sh=0;38;2;80;161;79:*.gv=0;38;2;80;161;79:*.ll=0;38;2;80;161;79:*.as=0;38;2;80;161;79:*.ko=1;38;2;228;86;73:*.bc=0;38;2;102;102;102:*.rm=0;38;2;255;106;193:*.jl=0;38;2;80;161;79:*.xz=4;38;2;1;132;188:*.so=1;38;2;228;86;73:*.hs=0;38;2;80;161;79:*.rs=0;38;2;80;161;79:*.cc=0;38;2;80;161;79:*.pp=0;38;2;80;161;79:*.cs=0;38;2;80;161;79:*.pl=0;38;2;80;161;79:*.hi=0;38;2;102;102;102:*.bmp=0;38;2;255;106;193:*TODO=1:*.tgz=4;38;2;1;132;188:*.zip=4;38;2;1;132;188:*.zsh=0;38;2;80;161;79:*.mp4=0;38;2;255;106;193:*.xcf=0;38;2;255;106;193:*.pbm=0;38;2;255;106;193:*.deb=4;38;2;1;132;188:*.inl=0;38;2;80;161;79:*.htc=0;38;2;80;161;79:*.inc=0;38;2;80;161;79:*.htm=0;38;2;193;132;1:*.tbz=4;38;2;1;132;188:*.epp=0;38;2;80;161;79:*.tml=0;38;2;193;132;1:*.cxx=0;38;2;80;161;79:*.ltx=0;38;2;80;161;79:*.ini=0;38;2;193;132;1:*.fls=0;38;2;102;102;102:*.tmp=0;38;2;102;102;102:*.bat=1;38;2;228;86;73:*.sbt=0;38;2;80;161;79:*.txt=0;38;2;193;132;1:*.iso=4;38;2;1;132;188:*.wmv=0;38;2;255;106;193:*.svg=0;38;2;255;106;193:*.swp=0;38;2;102;102;102:*.bag=4;38;2;1;132;188:*.ico=0;38;2;255;106;193:*.bak=0;38;2;102;102;102:*.sxi=0;38;2;228;86;73:*.pps=0;38;2;228;86;73:*.kts=0;38;2;80;161;79:*.mov=0;38;2;255;106;193:*.dmg=4;38;2;1;132;188:*.flv=0;38;2;255;106;193:*.blg=0;38;2;102;102;102:*.fon=0;38;2;255;106;193:*.rar=4;38;2;1;132;188:*.toc=0;38;2;102;102;102:*.rtf=0;38;2;228;86;73:*.log=0;38;2;102;102;102:*.yml=0;38;2;193;132;1:*.bin=4;38;2;1;132;188:*.ppt=0;38;2;228;86;73:*.hpp=0;38;2;80;161;79:*.idx=0;38;2;102;102;102:*.mir=0;38;2;80;161;79:*.pod=0;38;2;80;161;79:*.csx=0;38;2;80;161;79:*.hxx=0;38;2;80;161;79:*.pgm=0;38;2;255;106;193:*.tsx=0;38;2;80;161;79:*.odt=0;38;2;228;86;73:*.ipp=0;38;2;80;161;79:*.bz2=4;38;2;1;132;188:*.xml=0;38;2;193;132;1:*.ics=0;38;2;228;86;73:*.nix=0;38;2;193;132;1:*.pkg=4;38;2;1;132;188:*.dll=1;38;2;228;86;73:*.avi=0;38;2;255;106;193:*.fsi=0;38;2;80;161;79:*.jpg=0;38;2;255;106;193:*.m4a=0;38;2;255;106;193:*.otf=0;38;2;255;106;193:*.fsx=0;38;2;80;161;79:*.awk=0;38;2;80;161;79:*.eps=0;38;2;255;106;193:*.tar=4;38;2;1;132;188:*.swf=0;38;2;255;106;193:*.def=0;38;2;80;161;79:*.rpm=4;38;2;1;132;188:*.zst=4;38;2;1;132;188:*.bsh=0;38;2;80;161;79:*.sxw=0;38;2;228;86;73:*.vim=0;38;2;80;161;79:*.tcl=0;38;2;80;161;79:*.cgi=0;38;2;80;161;79:*.tex=0;38;2;80;161;79:*.pas=0;38;2;80;161;79:*.wma=0;38;2;255;106;193:*.csv=0;38;2;193;132;1:*.mpg=0;38;2;255;106;193:*.sql=0;38;2;80;161;79:*.dpr=0;38;2;80;161;79:*.mp3=0;38;2;255;106;193:*.png=0;38;2;255;106;193:*.ind=0;38;2;102;102;102:*.jar=4;38;2;1;132;188:*.apk=4;38;2;1;132;188:*.mkv=0;38;2;255;106;193:*.pyo=0;38;2;102;102;102:*.php=0;38;2;80;161;79:*.kex=0;38;2;228;86;73:*.ilg=0;38;2;102;102;102:*.bib=0;38;2;193;132;1:*.xlr=0;38;2;228;86;73:*.xls=0;38;2;228;86;73:*.h++=0;38;2;80;161;79:*.asa=0;38;2;80;161;79:*.pyc=0;38;2;102;102;102:*.mli=0;38;2;80;161;79:*.vob=0;38;2;255;106;193:*.pid=0;38;2;102;102;102:*.ppm=0;38;2;255;106;193:*.cpp=0;38;2;80;161;79:*.m4v=0;38;2;255;106;193:*.clj=0;38;2;80;161;79:*.gif=0;38;2;255;106;193:*.doc=0;38;2;228;86;73:*.com=1;38;2;228;86;73:*.vcd=4;38;2;1;132;188:*.exs=0;38;2;80;161;79:*.git=0;38;2;102;102;102:*.bst=0;38;2;193;132;1:*.pro=0;38;2;80;161;79:*.erl=0;38;2;80;161;79:*.img=4;38;2;1;132;188:*.aif=0;38;2;255;106;193:*.arj=4;38;2;1;132;188:*.rst=0;38;2;193;132;1:*.ttf=0;38;2;255;106;193:*.ods=0;38;2;228;86;73:*hgrc=0;38;2;80;161;79:*.aux=0;38;2;102;102;102:*.dox=0;38;2;80;161;79:*.fnt=0;38;2;255;106;193:*.bbl=0;38;2;102;102;102:*.psd=0;38;2;255;106;193:*.xmp=0;38;2;193;132;1:*.mid=0;38;2;255;106;193:*.ogg=0;38;2;255;106;193:*.bcf=0;38;2;102;102;102:*.cfg=0;38;2;193;132;1:*.exe=1;38;2;228;86;73:*.tif=0;38;2;255;106;193:*.dot=0;38;2;80;161;79:*.elm=0;38;2;80;161;79:*.pdf=0;38;2;228;86;73:*.odp=0;38;2;228;86;73:*.lua=0;38;2;80;161;79:*.c++=0;38;2;80;161;79:*.pyd=0;38;2;102;102;102:*.out=0;38;2;102;102;102:*.gvy=0;38;2;80;161;79:*.sty=0;38;2;102;102;102:*.ps1=0;38;2;80;161;79:*.wav=0;38;2;255;106;193:*.lisp=0;38;2;80;161;79:*.epub=0;38;2;228;86;73:*.flac=0;38;2;255;106;193:*.conf=0;38;2;193;132;1:*.toml=0;38;2;193;132;1:*.psd1=0;38;2;80;161;79:*.diff=0;38;2;80;161;79:*.opus=0;38;2;255;106;193:*.lock=0;38;2;102;102;102:*.tiff=0;38;2;255;106;193:*.json=0;38;2;193;132;1:*.fish=0;38;2;80;161;79:*.java=0;38;2;80;161;79:*.psm1=0;38;2;80;161;79:*.dart=0;38;2;80;161;79:*.xlsx=0;38;2;228;86;73:*.orig=0;38;2;102;102;102:*.webm=0;38;2;255;106;193:*.docx=0;38;2;228;86;73:*.jpeg=0;38;2;255;106;193:*.tbz2=4;38;2;1;132;188:*.yaml=0;38;2;193;132;1:*.less=0;38;2;80;161;79:*.purs=0;38;2;80;161;79:*.rlib=0;38;2;102;102;102:*.html=0;38;2;193;132;1:*.bash=0;38;2;80;161;79:*.h264=0;38;2;255;106;193:*.pptx=0;38;2;228;86;73:*.mpeg=0;38;2;255;106;193:*.hgrc=0;38;2;80;161;79:*.make=0;38;2;80;161;79:*.cabal=0;38;2;80;161;79:*.shtml=0;38;2;193;132;1:*README=0;38;2;250;250;250;48;2;193;132;1:*.class=0;38;2;102;102;102:*shadow=0;38;2;193;132;1:*.swift=0;38;2;80;161;79:*.xhtml=0;38;2;193;132;1:*.ipynb=0;38;2;80;161;79:*.cmake=0;38;2;80;161;79:*.cache=0;38;2;102;102;102:*passwd=0;38;2;193;132;1:*.mdown=0;38;2;193;132;1:*.dyn_o=0;38;2;102;102;102:*.scala=0;38;2;80;161;79:*.toast=4;38;2;1;132;188:*.patch=0;38;2;80;161;79:*TODO.md=1:*LICENSE=0;38;2;153;153;153:*.flake8=0;38;2;80;161;79:*.gradle=0;38;2;80;161;79:*.config=0;38;2;193;132;1:*.ignore=0;38;2;80;161;79:*.dyn_hi=0;38;2;102;102;102:*COPYING=0;38;2;153;153;153:*.matlab=0;38;2;80;161;79:*.groovy=0;38;2;80;161;79:*INSTALL=0;38;2;250;250;250;48;2;193;132;1:*setup.py=0;38;2;80;161;79:*TODO.txt=1:*Makefile=0;38;2;80;161;79:*.desktop=0;38;2;193;132;1:*.gemspec=0;38;2;80;161;79:*Doxyfile=0;38;2;80;161;79:*configure=0;38;2;80;161;79:*.DS_Store=0;38;2;102;102;102:*.rgignore=0;38;2;80;161;79:*README.md=0;38;2;250;250;250;48;2;193;132;1:*.fdignore=0;38;2;80;161;79:*.kdevelop=0;38;2;80;161;79:*.cmake.in=0;38;2;80;161;79:*COPYRIGHT=0;38;2;153;153;153:*.markdown=0;38;2;193;132;1:*CODEOWNERS=0;38;2;80;161;79:*.localized=0;38;2;102;102;102:*INSTALL.md=0;38;2;250;250;250;48;2;193;132;1:*Dockerfile=0;38;2;193;132;1:*.scons_opt=0;38;2;102;102;102:*README.txt=0;38;2;250;250;250;48;2;193;132;1:*SConscript=0;38;2;80;161;79:*.gitconfig=0;38;2;80;161;79:*SConstruct=0;38;2;80;161;79:*.gitignore=0;38;2;80;161;79:*.synctex.gz=0;38;2;102;102;102:*INSTALL.txt=0;38;2;250;250;250;48;2;193;132;1:*.gitmodules=0;38;2;80;161;79:*MANIFEST.in=0;38;2;80;161;79:*Makefile.am=0;38;2;80;161;79:*Makefile.in=0;38;2;102;102;102:*LICENSE-MIT=0;38;2;153;153;153:*.travis.yml=0;38;2;80;161;79:*appveyor.yml=0;38;2;80;161;79:*configure.ac=0;38;2;80;161;79:*.applescript=0;38;2;80;161;79:*CONTRIBUTORS=0;38;2;250;250;250;48;2;193;132;1:*.fdb_latexmk=0;38;2;102;102;102:*.clang-format=0;38;2;80;161;79:*CMakeLists.txt=0;38;2;80;161;79:*LICENSE-APACHE=0;38;2;153;153;153:*CMakeCache.txt=0;38;2;102;102;102:*.gitattributes=0;38;2;80;161;79:*CONTRIBUTORS.md=0;38;2;250;250;250;48;2;193;132;1:*requirements.txt=0;38;2;80;161;79:*CONTRIBUTORS.txt=0;38;2;250;250;250;48;2;193;132;1:*.sconsign.dblite=0;38;2;102;102;102:*package-lock.json=0;38;2;102;102;102:*.CFUserTextEncoding=0;38;2;102;102;102" + +if which exa > /dev/null 2>&1 ; then + alias ls="exa --icons -F -g" +else + alias ls="ls -G" +fi +alias grep='grep --colour=auto' +alias egrep='egrep --colour=auto' +alias fgrep='fgrep --colour=auto' + +case ":${PATH}:" in + *:"$HOME/.cargo/bin":*) + ;; + *) + # Prepending path in case a system-installed rustc needs to be overridden + export PATH="$HOME/.cargo/bin:$PATH" + ;; +esac + diff --git a/setup-mac.sh b/setup-mac.sh new file mode 100755 index 0000000..edf56c8 --- /dev/null +++ b/setup-mac.sh @@ -0,0 +1,148 @@ +#!/bin/sh + +mkdir -p "$HOME/.config" + +mkdir -p "$HOME/.config/nix" +if [ ! -f "$HOME/.config/nix/nix.conf" ] ; then + echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf + echo "trusted-users = root andrew" | sudo tee -a /etc/nix/nix.conf && sudo pkill nix-daemon + cachix use devenv +fi + +nix profile install nixpkgs#chezmoi +nix profile install nixpkgs#direnv +nix profile install nixpkgs#zoxide +nix profile install nixpkgs#htop +nix profile install nixpkgs#fzf +nix profile install nixpkgs#vim +nix profile install nixpkgs#git +nix profile install nixpkgs#helix +nix profile install nixpkgs#du-dust +nix profile install nixpkgs#bat +nix profile install nixpkgs#delta +nix profile install nixpkgs#starship +nix profile install nixpkgs#gnugrep +nix profile install nixpkgs#ripgrep +nix profile install nixpkgs#upterm +nix profile install nixpkgs#mosh +nix profile install nixpkgs#bashInteractive + +if [ ! -e /Applications/kitty.app ] ; then + curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin +fi + +mkdir -p "$HOME/.config/kitty" + +cat < "$HOME/.config/kitty/kitty.conf" +font_family Operator Mono Book +#bold_font Operator Mono Bold +#italic_font Operator Mono Italic +#bold_italic_font Operator Mono Bold Italic +font_size 20.0 +cursor_shape block +shell_integration no-cursor +tab_bar_edge top +symbol_map U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0C8,U+E0CA,U+E0CC-U+E0D2,U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E62F,U+E700-U+E7C5,U+F000-U+F2E0,U+F300-U+F31C,U+F400-U+F4A9,U+F500-U+F8FF Symbols Nerd Font +remember_window_size yes +initial_window_width 130c +initial_window_height 35c + +# BEGIN_KITTY_THEME +# Atom One Light +include current-theme.conf +# END_KITTY_THEME +EOF + +curl -Lo "$HOME/.config/kitty/current-theme.conf" https://git.penguincoder.org/penguincoder/dotfiles/raw/branch/main/dot_config/kitty/current-theme.conf + +curl -Lo "$HOME/.config/starship.toml" https://git.penguincoder.org/penguincoder/dotfiles/raw/branch/main/dot_config/starship.toml + +mkdir -p "$HOME/.config/helix" +curl -Lo "$HOME/.config/helix/config.toml" https://git.penguincoder.org/penguincoder/dotfiles/raw/branch/main/dot_config/helix/config.toml + +mkdir -p "$HOME/.config/git" +curl -Lo "$HOME/.config/git/delta.gitconfig" https://git.penguincoder.org/penguincoder/dotfiles/raw/branch/main/dot_config/git/delta.gitconfig + +cat < "$HOME/.gitconfig" +[include] + path = /Users/andrew/.config/git/delta.gitconfig + +[push] + default = simple + +[user] + name = Andrew Coleman + email = penguincoder@gmail.com + +[advice] + detachedHead = false + +[core] + filemode = true + eol = lf + autocrlf = input + pager = delta + +[init] + defaultBranch = main + +[delta] + line-numbers = true + #line-numbers-zero-style = white + line-numbers-minus-style = bold red + line-numbers-plus-style = bold green + file-style = omit + hunk-header-style = file + syntax-theme = OneHalfLight + +[rebase] + autoStash = true + +[merge] + tool = vimdiff + conflictstyle = diff3 + prompt = false + +[pull] + rebase = true + +[color] + branch = auto + diff = auto + status = auto + ui = true + +[color "branch"] + current = yellow reverse + local = yellow + remote = green + +[color "diff"] + meta = yellow bold + frag = magenta bold + old = red bold + new = green bold + +[color "status"] + added = yellow + changed = green + untracked = red + +[alias] + logp = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short + lg = log --graph --date-order --first-parent \ + --pretty=format:'%C(auto)%h%Creset %C(auto)%d%Creset %s %C(green)(%ad) %C(bold cyan)<%an>%Creset' + lgb = log --graph --date-order --branches --first-parent \ + --pretty=format:'%C(auto)%h%Creset %C(auto)%d%Creset %s %C(green)(%ad) %C(bold cyan)<%an>%Creset' + lga = log --graph --date-order --all \ + --pretty=format:'%C(auto)%h%Creset %C(auto)%d%Creset %s %C(green)(%ad) %C(bold cyan)<%an>%Creset' + up = pull --rebase + branches-last-updated = branch -rv --sort=committerdate --format='%(HEAD) %(color:green)%(committerdate:relative)%(color:reset)\t%(color:magenta)%(authorname)%(color:reset)\t%(color:yellow)%(refname:short)%(color:reset)' +EOF + +if [ ! -d "$HOME/.cargo" ] ; then + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path --default-toolchain stable --profile complete -y +fi + +curl -Lo "$HOME/.tmux.conf" https://git.penguincoder.org/penguincoder/dotfiles/raw/branch/main/dot_tmux.conf +curl -Lo "$HOME/.vimrc" https://git.penguincoder.org/penguincoder/dotfiles/raw/branch/main/dot_vimrc