-
Notifications
You must be signed in to change notification settings - Fork 0
chore: dotfiles cleanup and portability fixes #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
ff83ee6
d758048
91bbd55
426187c
0e784f5
844305f
675c31a
480f6ac
a057bc7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,35 @@ | ||
| # Dotfiles | ||
|
|
||
| The dotfiles are managed using dotdrop: | ||
| https://github.com/deadc0de6/dotdrop | ||
| Managed using [dotdrop](https://github.com/deadc0de6/dotdrop). | ||
|
|
||
| ## Setup on a new machine | ||
|
|
||
| ```shell | ||
| # To setup on clean system: | ||
| bash ./install/mac-bootstrap.h | ||
| ``` | ||
| bash ./install/mac-bootstrap.sh | ||
| ``` | ||
|
|
||
| ## Install dotfiles on current machine | ||
|
|
||
| ```shell | ||
| # Dry-run (preview changes without applying) | ||
| ./dotdrop/dotdrop.sh -c "$PWD/config.yaml" install -p $(hostname) --dry | ||
|
|
||
| # Apply | ||
| ./dotdrop/dotdrop.sh -c "$PWD/config.yaml" install -p $(hostname) | ||
| ``` | ||
|
|
||
| > Note: `-c "$PWD/config.yaml"` is required — the dotdrop submodule changes its working | ||
| > directory at runtime, so a relative path won't resolve to the repo's config. | ||
|
|
||
| ## Add a new machine | ||
|
|
||
| Add a profile to `config.yaml` using `include` to inherit the base dotfile set: | ||
|
|
||
| ```yaml | ||
| profiles: | ||
| Your-Hostname.local: | ||
| include: | ||
| - Simonass-MacBook-Pro.local | ||
| ``` | ||
|
|
||
| Then run the install command above with your hostname. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,4 @@ | |
| *.swp | ||
| *.swo | ||
| Gemfile.lock | ||
| .cursor | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,5 @@ | ||
| # zmodload zsh/zprof | ||
|
|
||
| DEFAULT_USER=whoami`` | ||
|
|
||
| # system detection | ||
| function detect_system() { | ||
| local _uname_a=$(uname -a) | ||
|
|
@@ -22,6 +20,11 @@ function detect_system() { | |
| } | ||
| detect_system | ||
|
|
||
| # Ensure TMPDIR is always set correctly on macOS (fixes kitty terminal inheritance) | ||
| if [[ "$SYSTEM" == "Darwin" ]]; then | ||
| export TMPDIR=$(getconf DARWIN_USER_TEMP_DIR) | ||
| fi | ||
|
|
||
| # | ||
| # https://gist.github.com/ctechols/ca1035271ad134841284 | ||
| # https://carlosbecker.com/posts/speeding-up-zsh | ||
|
|
@@ -50,7 +53,7 @@ PROMPT=" $PROMPT " | |
| PROMPT='%(?.%F{magenta}.%F{red}❯%F{magenta})❯%f ' | ||
|
|
||
| # fzf-tab | ||
| source ~/git/fzf-tab/fzf-tab.plugin.zsh | ||
| [ -f ~/git/fzf-tab/fzf-tab.plugin.zsh ] && source ~/git/fzf-tab/fzf-tab.plugin.zsh | ||
|
|
||
| HISTSIZE=10000 | ||
| SAVEHIST=10000 | ||
|
|
@@ -83,10 +86,9 @@ bindkey "^[[1;9D" beginning-of-line | |
| bindkey "^[[1;9C" end-of-line | ||
|
|
||
| # Load stuff | ||
| source ~/.zsh_env_vars | ||
| # source ~/.zsh_terragrunt_vars | ||
| [ -f ~/.zsh_env_vars ] && source ~/.zsh_env_vars | ||
| source ~/.zsh_git_aliases | ||
| source ~/.zsh_vinted_aliases | ||
| [ -f ~/.zsh_vinted_aliases ] && source ~/.zsh_vinted_aliases | ||
|
Comment on lines
+89
to
+91
|
||
|
|
||
| # zstyle | ||
| # zstyle :prompt:pure:path color default | ||
|
|
@@ -95,10 +97,12 @@ source ~/.zsh_vinted_aliases | |
| [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh | ||
|
|
||
| # Alias | ||
| alias vi="/opt/homebrew/bin/nvim" | ||
| alias sr="ssh -A -o StrictHostKeyChecking=no -l srupsys $@" | ||
| alias p2="ping -i0.2 $@" | ||
| alias ll="ls -la $@" | ||
| alias vi=nvim | ||
| function sr() { ssh -A -o StrictHostKeyChecking=no -l srupsys "$@"; } | ||
| function sj() { ssh -A -o StrictHostKeyChecking=no -J srupsys@janitor1.ams1.int.vinted.com -l srupsys "$@"; } | ||
| alias p2="ping -i0.2" | ||
| alias ll="ls -la" | ||
| alias make=gmake | ||
| alias knife="~/bin/knife" | ||
| alias truck='bundle exec foodtruck' | ||
| function knaws(){ | ||
|
|
@@ -134,23 +138,20 @@ export PATH="$PYENV_ROOT/shims:$PATH" | |
| alias pyinit='eval "$(pyenv init -)"' | ||
|
|
||
| # rbenv | ||
| export PATH="/Users/simonas.rupsys/.rbenv/bin:$PATH" | ||
| export PATH="$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH" | ||
| alias rbinit='eval "$(rbenv init -)"' | ||
| # eval "$(rbenv init -)" | ||
|
|
||
| # goenv | ||
| export GOENV_ROOT="$HOME/.goenv" | ||
| export PATH="$GOENV_ROOT/bin:$PATH" | ||
| export PATH="$GOENV_ROOT/shims:$GOENV_ROOT/bin:$PATH" | ||
| alias goinit='eval "$(goenv init -)"' | ||
|
|
||
| # TODO: remove this. 1.1.1q openssl is broken. this is workaround | ||
| export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH" | ||
|
|
||
| # init all envs | ||
| alias init='pyinit;rbinit;goinit' | ||
| alias initenvs='pyinit;rbinit;goinit' | ||
| # uncomment to enable full shell integration (rbenv shell, completions): | ||
| # pyinit | ||
| rbinit | ||
| goinit | ||
| # rbinit | ||
| # goinit | ||
|
|
||
| # You may need to manually set your language environment | ||
| # export LANG=en_US.UTF-8 | ||
|
|
@@ -162,35 +163,19 @@ else | |
| export EDITOR='nvim' | ||
| fi | ||
|
|
||
| # Overcommit | ||
| check_overcommit() { | ||
| if [ -d ".git" ]; then | ||
| template="$HOME/.overcommit.yml" | ||
| if [ ! -L ".overcommit.yml" ]; then | ||
| echo 'Installing .overcommit.yml' | ||
| ln -sf "$template" "$(pwd)/.overcommit.yml" | ||
| overcommit --install | ||
| overcommit --sign | ||
| fi | ||
| fi | ||
| } | ||
|
|
||
| # Install .overcommit.yml to git repos | ||
| precmd() { # run before each prompt | ||
| # check_overcommit | ||
| } | ||
|
|
||
| #zprof | ||
| source "${DEVTOOLS_PATH:-$HOME/vinted/dev-tools}/bin/shell_function.sh" | ||
|
|
||
| # tfenv path | ||
| # export PATH="$HOME/.tfenv/bin:$PATH" | ||
| [ -f "${DEVTOOLS_PATH:-$HOME/vinted/dev-tools}/bin/shell_function.sh" ] && \ | ||
| source "${DEVTOOLS_PATH:-$HOME/vinted/dev-tools}/bin/shell_function.sh" | ||
|
|
||
| export PATH="$HOME/bin:$PATH" | ||
|
|
||
| # export TERM=xterm-kitty | ||
|
|
||
| eval $(thefuck --alias) | ||
| command -v thefuck &>/dev/null && eval "$(thefuck --alias)" | ||
|
|
||
| autoload -U +X bashcompinit && bashcompinit | ||
| complete -o nospace -C /opt/homebrew/bin/nomad nomad | ||
| complete -o nospace -C "$(command -v nomad)" nomad | ||
|
|
||
| export PATH="$HOME/.local/bin:$PATH" | ||
|
|
||
| # opencode | ||
| export PATH="$HOME/.opencode/bin:$PATH" | ||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,8 @@ | ||||||||||
| #!/bin/bash | ||||||||||
| set -e | ||||||||||
|
|
||||||||||
| sudo chown -R simonas.rupsys ~/.config/ | ||||||||||
| sudo chown -R simonas.rupsys ~/.local/share | ||||||||||
| sudo chown -R "$USER" ~/.config/ | ||||||||||
| sudo chown -R "$USER" ~/.local/share | ||||||||||
|
Comment on lines
+4
to
+5
|
||||||||||
| sudo chown -R "$USER" ~/.config/ | |
| sudo chown -R "$USER" ~/.local/share | |
| sudo chown -R "${SUDO_USER:-$USER}" ~/.config/ | |
| sudo chown -R "${SUDO_USER:-$USER}" ~/.local/share |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,5 @@ | ||||||||||
| #!/bin/bash | ||||||||||
| set -e | ||||||||||
| # Pasiskolinta is https://github.com/japorized/dotfiles/tree/master/install | ||||||||||
|
|
||||||||||
| # Ensure user has edited config.yaml and the dotfiles for proper installation | ||||||||||
|
|
@@ -25,7 +26,7 @@ echo 'Installing xcode cli tools' | |||||||||
|
|
||||||||||
| echo 'Installing Homebrew' | ||||||||||
| /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | ||||||||||
| echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/simonas.rupsys/.zprofile | ||||||||||
| echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> "$HOME/.zprofile" | ||||||||||
|
||||||||||
| echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> "$HOME/.zprofile" | |
| if ! grep -q 'eval "$(/opt/homebrew/bin/brew shellenv)"' "$HOME/.zprofile" 2>/dev/null; then | |
| echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> "$HOME/.zprofile" | |
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
safe.directoryexpects an absolute path in many Git versions;~is not consistently expanded for this setting, which can leave the repo still treated as unsafe. To keep this portable, consider setting this value via an install step that writes the absolute$HOME/.goenvpath (e.g.,git config --global --add safe.directory ...) or use dotdrop templating to render an absolute path per machine.