Skip to content

Commit

Permalink
fix(nixos/osx): setup git before nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianoliveira committed Aug 24, 2024
1 parent 447548d commit 32b50ce
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
1 change: 1 addition & 0 deletions git/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ read git_user_name
echo ">>> Please enter your git email:"
read git_email

export $GIT_USER_NAME="$git_user_name"
if [ -z "$git_user_name" ] || [ -z "$git_email" ]; then
echo "Please provide a valid git user name and email."
exit 1
Expand Down
6 changes: 1 addition & 5 deletions nix/nixos/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ $HOME/.dotfiles/nix/nixos/ulauncher/setup.sh
$HOME/.dotfiles/nix/nixos/rclone/setup.sh

echo "Setting up shared applications"
$HOME/.dotfiles/nvim/setup.sh
$HOME/.dotfiles/tmux/setup.sh
$HOME/.dotfiles/zsh/setup.sh
$HOME/.dotfiles/nix/shared/alacritty/setup.sh
$HOME/.dotfiles/git/setup.sh
"$HOME"/.dotfiles/nix/shared/setup.sh

echo "System is ready to be built with ~/.dotfiles/nix/rebuild.sh"
6 changes: 1 addition & 5 deletions nix/osx/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,8 @@ echo "Setting up OSX applications"
"$HOME"/.dotfiles/nix/osx/karabiner/setup.sh

echo "Setting up shared applications"
"$HOME"/.dotfiles/nvim/setup.sh
"$HOME"/.dotfiles/tmux/setup.sh
"$HOME"/.dotfiles/zsh/setup.sh
"$HOME"/.dotfiles/nix/shared/alacritty/setup.sh
"$HOME"/.dotfiles/nix/shared/setup.sh
"$HOME"/.dotfiles/nix/osx/alacritty/setup.sh
"$HOME"/.dotfiles/git/setup.sh

# So darwin-rebuild is available in the new shell
sh -c "$HOME/.dotfiles/nix/rebuild.sh"
Expand Down
10 changes: 10 additions & 0 deletions nix/shared/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

echo "Running shared setup"

echo "Setting up shared applications"
$HOME/.dotfiles/git/setup.sh
$HOME/.dotfiles/nvim/setup.sh
$HOME/.dotfiles/tmux/setup.sh
$HOME/.dotfiles/zsh/setup.sh
$HOME/.dotfiles/nix/shared/alacritty/setup.sh
5 changes: 3 additions & 2 deletions nvim/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ echo "Configuring nvim"

if [ -d "$HOME"/.local/share/nvim ]; then
echo "Backing up your current state: mazon & lazy.nvim"
mv "$HOME"/.local/share/nvim /tmp/"$BACKUPNAME"/sharenvim
mv "$HOME/.local/share/nvim" "/tmp/$BACKUPNAME/sharenvim"
mv "$HOME/.local/state/nvim" "/tmp/$BACKUPNAME/statenvim"
fi

mkdir -p "$HOME"/.local/share/nvim
git clone --filter=blob:none --branch=stable \
https://github.com/folke/lazy.nvim.git "$HOME"/.local/share/nvim/lazy
https://"$GIT_USER_NAME"@github.com/folke/lazy.nvim.git "$HOME"/.local/share/nvim/lazy

echo "Linking config to $HOME/.config/nvim"
if [ -f "$HOME"/.config/nvim ]; then
Expand Down

0 comments on commit 32b50ce

Please sign in to comment.