Skip to content

Commit

Permalink
Merge branch 'master' of github.com:duckworthd/dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
duckworthd committed Jan 18, 2025
2 parents 926562b + adc4cf2 commit 68cb2b3
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 18 deletions.
1 change: 1 addition & 0 deletions dotfiles/config/ghostty/config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
font-size = 12
46 changes: 33 additions & 13 deletions dotfiles/zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,20 @@ ZSH_THEME="robbyrussell"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Normally, tab completion for paths will try to complete each component of a
# path. For example, "cd /usr/local/bi<TAB>" will look for suggest both
# "/usr/local/bin" *and* "/usr_v2/local/bin". Setting this options prevents
# this behavior if the prefix matches an existing directory. This accelerates
# tab completion when interacting with network filesystems with a large number
# of subdirectories.
zstyle ':completion:*' accept-exact-dirs true

# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
fzf
git
)
plugins=(fzf git)

if [[ -d "$HOME/.oh-my-zsh/custom/themes/powerlevel10k" ]]; then
ZSH_THEME="powerlevel10k/powerlevel10k"
Expand Down Expand Up @@ -108,6 +113,13 @@ fi
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

# Enable homebrew if possible

if [[ -d "/opt/homebrew/bin" ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi


# Include local /bin directories.
export PATH="$HOME/bin:$HOME/.local/bin:$PATH"

Expand Down Expand Up @@ -157,15 +169,23 @@ if type nvim &> /dev/null; then
alias vim=nvim
fi

# Anaconda
if [[ -d "/usr/local/anaconda3/bin" ]]; then
export PATH="/usr/local/anaconda3/bin:${PATH}"
# Add CUDA to PATH.
local CUDA_BIN=/usr/local/cuda/bin
if [[ -d "${CUDA_BIN}" ]]; then
PATH="${CUDA_BIN}:${PATH}"
fi

# Import pyenv
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
if type "pyenv" > /dev/null; then
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('$HOME/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "$HOME/miniconda3/etc/profile.d/conda.sh" ]; then
. "$HOME/miniconda3/etc/profile.d/conda.sh"
else
export PATH="$HOME/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
6 changes: 4 additions & 2 deletions provisioning/apt.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ def neovim(c):
@task(requests)
def tmux(c):
"""Install tmux, a terminal multiplexer, from source."""
TMUX_VERSION = "3.5a"

if os.path.exists(os.path.expanduser("~/bin/tmux")):
return

Expand All @@ -122,15 +124,15 @@ def tmux(c):

# Downlaod tarball.
response = requests.get(
"https://github.com/tmux/tmux/releases/download/3.1b/tmux-3.1b.tar.gz")
f"https://github.com/tmux/tmux/releases/download/{TMUX_VERSION}/tmux-{TMUX_VERSION}.tar.gz")
tar_path = "/tmp/tmux.tar.gz"
with open(tar_path, "wb") as tarfile:
tarfile.write(response.content)

# Extract its contents.
utils.print_run(c, f"tar -zxf {tar_path} --directory /tmp", hide="out")

with utils.chdir("/tmp/tmux-3.1b"):
with utils.chdir(f"/tmp/tmux-{TMUX_VERSION}"):
# Build it.
utils.print_run(c, "./configure --enable-static", hide="out")
utils.print_run(c, "make", hide="out")
Expand Down
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash -i
#!/usr/bin/env bash
#
# This script uses "invoke", a Python package akin to Ruby's rake, to provision
# a system with standard apps duckworthd@ uses. If invoke isn't installed, it
Expand Down
6 changes: 5 additions & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


DEPENDENCIES = {
'Linux:': (
'Linux': (
core.dotfiles,
apt.ag,
apt.fzf,
Expand Down Expand Up @@ -42,6 +42,10 @@
)
}

if platform.system() not in DEPENDENCIES:
raise NotImplementedError(f"Unrecognized platform: {platform.system()}")


@task(*DEPENDENCIES[platform.system()])
def all(c):
"""Install all dependencies."""
Expand Down

0 comments on commit 68cb2b3

Please sign in to comment.