Skip to content

Commit

Permalink
Install with stow
Browse files Browse the repository at this point in the history
  • Loading branch information
Jendker committed Sep 25, 2024
1 parent f97ca59 commit 6665fa1
Show file tree
Hide file tree
Showing 40 changed files with 72 additions and 38 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,4 @@ jobs:

- name: Run setup
run: |
./install.sh
if [[ "$RUNNER_OS" == "Linux" ]]; then
./set_up_debian.sh
./set_up_debian_dev.sh --optional
elif [[ "$RUNNER_OS" == "macOS" ]]; then
./macos/install.sh
./macos/set_defaults.sh --optional
fi
./scripts/install.sh
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nvim/lua/machine_settings.lua
common/.config/nvim/lua/machine_settings.lua
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion nvim/lazy-lock.json → common/.config/nvim/lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" },
"quicker.nvim": { "branch": "master", "commit": "183041a46d6c908eefb1c23ea02cce9c8f41256e" },
"render-markdown.nvim": { "branch": "main", "commit": "0986638b381a4b01eb108bb946f3a67a9eb3d0ec" },
"render-markdown.nvim": { "branch": "main", "commit": "67288febca78b7aac8fae9543ef8980237e27d2a" },
"spaceless.nvim": { "branch": "main", "commit": "8d46bc098dba18d4e19bce89bf19aab5007ef767" },
"stickybuf.nvim": { "branch": "master", "commit": "183b9569bef78f44b17c078214f7d731f19cbefe" },
"substitute.nvim": { "branch": "main", "commit": "17ffaeb5a1dc2dbef39cf0865d8a4b6000836714" },
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 8 additions & 2 deletions .wezterm.lua → common/.wezterm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,17 @@ config.font_size = 11
if wezterm.target_triple == 'aarch64-apple-darwin' then
config.window_close_confirmation = 'NeverPrompt'
config.window_decorations = "RESIZE"
config.font = wezterm.font{
local weight = "Medium"
config.font_size = 12
if wezterm.hostname() == "Jedrzejs-Mac-mini.local" then
config.font_size = 13
weight = "Bold"
end
config.font = wezterm.font {
family = 'Monaco Nerd Font',
harfbuzz_features = { 'ss07', 'calt', 'liga=0' },
weight = weight,
}
config.font_size = 12
config.native_macos_fullscreen_mode = true
else
-- disable the window title bar
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions debian/clangd
2 changes: 1 addition & 1 deletion dotfiles_private
17 changes: 17 additions & 0 deletions macos/.unison/default.prf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# roots define root directories for syncing between
root = /Users/jedrzej/Library/Mobile Documents/iCloud~md~obsidian/Documents/
root = /Users/jedrzej/Dropbox/ObsidianVaults/

# dirs to sync
path=Personal

# don't ask for confirmation
auto=true
batch=true
# sync ownership and group
owner=true
group=true
# for safety
confirmbigdel=true
# prefer newer in case of conflicts
prefer=newer
1 change: 1 addition & 0 deletions macos/Library/Preferences/clangd
File renamed without changes.
4 changes: 3 additions & 1 deletion set_up_debian.sh → scripts/debian/install_min.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
set -e

SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)

function get_highest_tag_version() {
git tag | sort -V | tail -n 1
}
Expand Down Expand Up @@ -265,7 +267,7 @@ ln -s $(which fdfind) $HOME/.local/bin/fd || true
sudo apt install ripgrep -y || true

# run set_up_common.sh
./set_up_common.sh
"$SCRIPT_DIR/set_up_common.sh"

if command -v doit &>/dev/null; then
pipx install thefuck
Expand Down
51 changes: 32 additions & 19 deletions install.sh → scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -x
set -e

SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
ROOT_DIR=$(dirname "$SCRIPT_DIR")

copy=false
if [[ $1 == "--copy" ]]; then
Expand All @@ -19,35 +20,47 @@ function add() {
fi
}

# nvim
add "$SCRIPT_DIR/nvim" "$HOME/.config/nvim"

# clangd
# snippets
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
add "$SCRIPT_DIR/clangd" "$HOME/.config/clangd"
vscode_snippets_path="$HOME/.config/Code/User/snippets"
elif [[ "$OSTYPE" == "darwin"* ]]; then
macos_clangd_path="$HOME/Library/Preferences/clangd"
mkdir -p "$macos_clangd_path"
add "$SCRIPT_DIR/clangd" "$macos_clangd_path"
vscode_snippets_path="$HOME/Library/Application Support/Code/User/snippets"
else
echo "OS type unknown. Exiting."
exit 1
fi
mkdir -p "$(dirname "${vscode_snippets_path}")"
add "$SCRIPT_DIR/nvim/snippets" "${vscode_snippets_path}"

# tmux
add "$SCRIPT_DIR/.tmux.conf" "$HOME/.tmux.conf"
cd "$ROOT_DIR"

# .wezterm
add "$SCRIPT_DIR/.wezterm.lua" "$HOME/.wezterm.lua"
if ! [ -x "$(command -v stow)" ]; then
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
sudo apt install stow -y
elif [[ "$OSTYPE" == "darwin"* ]]; then
if ! [ -x "$(command -v brew)" ]; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
brew install stow
else
echo "Unsupported OS"
fi
fi

# snippets
# Stow common config
stow -t ~ common
stow -t ~ dotfiles_private/common

# Stow platform-specific config
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
vscode_snippets_path="$HOME/.config/Code/User/snippets"
stow -t ~ debian
stow -t ~ dotfiles_private/debian
scripts/debian/install_min.sh
scripts/debian/install.sh --optional
elif [[ "$OSTYPE" == "darwin"* ]]; then
vscode_snippets_path="$HOME/Library/Application Support/Code/User/snippets"
stow -t ~ macos
stow -t ~ dotfiles_private/macos
scripts/macos/install.sh
else
echo "OS type unknown. Exiting."
exit 1
echo "Unsupported OS"
fi
mkdir -p "$(dirname "${vscode_snippets_path}")"
add "$SCRIPT_DIR/nvim/snippets" "${vscode_snippets_path}"
11 changes: 6 additions & 5 deletions macos/install.sh → scripts/macos/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
set -e

SCRIPT_DIR=$(dirname $0)
ROOT_DIR=$(dirname "$SCRIPT_DIR")
SCRIPTS_DIR=$(dirname "$SCRIPT_DIR")
ROOT_DIR=$(realpath "../../${SCRIPT_DIR}")

$ROOT_DIR/set_up_common.sh
$SCRIPTS_DIR/set_up_common.sh

KEYBOARD_SOURCE_PATH="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Random/Keyboard Layouts/Polish-German.bundle"
KEYBOARD_TARGET_PATH="$HOME/Library/Keyboard Layouts/Polish-German.bundle"
Expand All @@ -20,7 +21,7 @@ if ! grep -Fxq "PasswordAuthentication no" "$SSH_CONFIG_PATH"; then
echo "ChallengeResponseAuthentication no" | sudo tee -a "$SSH_CONFIG_PATH"
fi

# karabiner config
rm "$HOME/.config/karabiner.edn"
ln -s "$ROOT_DIR/dotfiles_private/karabiner.edn" "$HOME/.config/karabiner.edn"
# run goku to install karabiner config
goku || echo "goku not installed. Install with brew and run 'goku' when possible."

$SCRIPT_DIR/set_defaults.sh
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 6665fa1

Please sign in to comment.