Skip to content

Commit a19777b

Browse files
committed
fix: correct install
1 parent d1133a2 commit a19777b

3 files changed

Lines changed: 44 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{ if eq .chezmoi.os "linux" -}}
2+
#!/bin/sh
3+
# Install Neovim plugins via Lazy.nvim
4+
# This runs after dotfiles are applied to pre-install all plugins
5+
6+
if ! command -v nvim >/dev/null 2>&1; then
7+
echo "Neovim not installed, skipping plugin installation"
8+
exit 0
9+
fi
10+
11+
echo "Installing Neovim plugins via Lazy..."
12+
13+
# Run Lazy sync in headless mode
14+
# - Lazy! (with bang) suppresses the UI
15+
# - sync installs missing plugins and updates existing ones
16+
nvim --headless "+Lazy! sync" "+qa"
17+
18+
echo "Neovim plugins installed"
19+
{{ end -}}

run_once_install-packages.sh.tmpl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,29 @@ if command -v batcat >/dev/null 2>&1 && ! command -v bat >/dev/null 2>&1; then
5050
sudo ln -sf "$(command -v batcat)" /usr/local/bin/bat
5151
fi
5252

53+
# Install Neovim via AppImage (Ubuntu repos have old version)
54+
if ! command -v nvim >/dev/null 2>&1; then
55+
curl -fsSL -o /tmp/nvim.appimage https://github.com/neovim/neovim/releases/download/stable/nvim-linux-x86_64.appimage
56+
chmod +x /tmp/nvim.appimage
57+
# Extract AppImage (works in containers without FUSE)
58+
cd /tmp && ./nvim.appimage --appimage-extract >/dev/null 2>&1
59+
sudo mv /tmp/squashfs-root /opt/nvim
60+
sudo ln -sf /opt/nvim/AppRun /usr/local/bin/nvim
61+
rm -f /tmp/nvim.appimage
62+
fi
63+
5364
{{ end -}}
5465
# Set fish as default shell (applies to all distros)
5566
if [ "$(getent passwd "$(whoami)" | cut -d: -f7)" != "$(which fish)" ]; then
5667
sudo chsh -s "$(which fish)" "$(whoami)"
5768
fi
5869

70+
# Install OpenCode
71+
if ! command -v opencode >/dev/null 2>&1 && ! test -x "$HOME/.opencode/bin/opencode"; then
72+
curl -fsSL https://opencode.ai/install | bash -s -- --no-modify-path
73+
# Symlink to a standard PATH location
74+
sudo ln -sf "$HOME/.opencode/bin/opencode" /usr/local/bin/opencode
75+
fi
76+
5977
echo "Portable CLI tools installed"
6078
{{ end -}}

test/verify.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ check "fish is default shell" "getent passwd \$(whoami) | grep -q fish"
4444
check "fisher installed" "fish -c 'type -q fisher'"
4545
check "fish_plugins file exists" "test -f ~/.config/fish/fish_plugins"
4646

47+
check "opencode installed" "command -v opencode"
48+
49+
echo ""
50+
echo "--- Neovim setup ---"
51+
check "lazy.nvim installed" "test -d ~/.local/share/nvim/lazy/lazy.nvim"
52+
check "nvim plugins synced" "test -f ~/.config/nvim/lazy-lock.json"
53+
4754
echo ""
4855
echo "--- Summary ---"
4956
echo "Passed: $PASS"

0 commit comments

Comments
 (0)