Skip to content

Commit

Permalink
MacOS 2024-08-06 (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
ADGEfficiency authored Dec 25, 2024
1 parent 5ec7503 commit 3d597aa
Show file tree
Hide file tree
Showing 37 changed files with 3,091 additions and 4,725 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ test: setup-nix

.PHONY: setup-pyenv python js

setup-pyenv:
bash ./python/setup-pyenv.sh
setup-uv:
bash ./python/setup-uv.sh

python: setup-pyenv
bash ./python/setup-general-venv.sh general 3.12.2
bash ./python/setup-general-venv-pkgs.sh
python: setup-uv
cd ~ && ~/.local/bin/uv venv --python 3.11.9
~/.local/bin/uv pip install -r ./python/pyproject.toml

js:
npm install -g @tailwindcss/language-server markserv
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This will also setup dependencies with Nix.

### Python

Install `pyenv` and `pyenv-virtualenv`, and setup a global Python installation in a pyenv virtual environment:
Install `uv` and setup a global Python installation in a virtual environment:

```bash
$ make python
Expand Down Expand Up @@ -76,7 +76,7 @@ $ make nix-pkgs -o setup-nix

### Neovim

Neovim config is in `./nvim`. To use the Neovim setup, put this folder (ie `.`, not `./nvim`) into `$XDG_CONFIG_HOME`.
Neovim config is in `./nvim`. To use the Neovim setup, put this folder into `$XDG_CONFIG_HOME`.

I use Lazy for package management in Neovim - it will install packages when you first open the editor.

Expand Down
4 changes: 4 additions & 0 deletions dotfiles/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source_env_if_exists ~/.envrc.secret
export TRACE=0
export VIRTUAL_ENV=."venv"
layout python
12 changes: 7 additions & 5 deletions dotfiles/common/.bash_profile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ export EDITOR=$(which nvim)
eval "$(zoxide init bash)"

# pyenv
source "$HOME/dotfiles/macos/pyenv-flags"
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
if [ "$DISABLE_PYENV" = "" ]; then
source "$HOME/dotfiles/macos/pyenv-flags"
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
fi

{ eval "$(ssh-agent)"; } &>/dev/null
eval "$(direnv hook bash)"
Expand Down
20 changes: 12 additions & 8 deletions dotfiles/common/.zshrc
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
bash $HOME/dotfiles/scripts/trace.sh "$0"

export DISABLE_PYENV=1

pyenv_init() {
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
export PIPENV_PYTHON="$PYENV_ROOT/shims/python"
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
if [ -z "$DISABLE_PYENV" ]; then
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
export PIPENV_PYTHON="$PYENV_ROOT/shims/python"
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi
}

fzf_init() {
export FZF_BASE=/usr/local/bin/fzf
bindkey -v
source ~/dotfiles/fzf/.fzf.zsh
source $HOME/.fzf.zsh
export FZF_DEFAULT_COMMAND='rg --files --hidden --smart-case --line-buffered --ignore-file ~/.gitignore'
export FZF_DEFAULT_OPTS='--height 40% --preview "bat -p {}" --preview-window=down:50%:wrap --border=none'
export FZF_CTRL_R_OPTS='--height 20% --no-preview'
Expand Down Expand Up @@ -60,7 +64,6 @@ SAVEHIST=$HISTSIZE
export AWS_LOG_LEVEL=3

alias brew='arch -arm64 brew'
source "$HOME/dotfiles/dotfiles/common/setup-path.sh"

source ~/dotfiles/macos/pyenv-flags

Expand All @@ -83,3 +86,4 @@ eval "$(direnv hook zsh)"
# done twice for a reason
pretzo_init
fzf_init
source "$HOME/dotfiles/dotfiles/common/setup-path.sh"
2 changes: 1 addition & 1 deletion dotfiles/common/setup-path.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ export PATH="$HOME/checkmake:$PATH"
export PATH="$HOME/dotfiles/scripts:$PATH"
export PATH="$HOME/personal/para/area/script:$PATH"
export PATH="$HOME/go/bin:$PATH"

export PATH="$HOME/.local/bin:$PATH"
export GOPATH="$HOME/go"
2 changes: 2 additions & 0 deletions dotfiles/macos/.bash_profile
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
source "$HOME"/dotfiles/dotfiles/common/.bash_profile
. "$HOME/.cargo/env"

. "$HOME/.local/bin/env"
2 changes: 2 additions & 0 deletions dotfiles/macos/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ source "$HOME"/dotfiles/dotfiles/common/.bashrc

[ -f ~/.fzf.bash ] && source ~/.fzf.bash
. "$HOME/.cargo/env"

. "$HOME/.local/bin/env"
4 changes: 3 additions & 1 deletion dotfiles/macos/.zshrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
source $HOME/dotfiles/dotfiles/common/.zshrc
# eval "$(gh copilot alias -- zsh)"
head -n 15 $HOME/personal/para/resource/cheat_sheet.md | tail -n 9 | bat --language=markdown -p --color=always --paging=never --theme=Dracula
head -n 20 $HOME/personal/para/resource/cheat_sheet.md | tail -n 14 | bat --language=markdown -p --color=always --paging=never --theme=Dracula

[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

. "$HOME/.local/bin/env"
5 changes: 0 additions & 5 deletions dotfiles/windows/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ SAVEHIST=$HISTSIZE
# after each command, save and reload history
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"


# ALIASES

export PYENV_GENERAL="$HOME/.pyenv/versions/3.10.6/envs/general/bin"

# experimental
alias p='nbe'

Expand Down
Loading

0 comments on commit 3d597aa

Please sign in to comment.