Compare commits

13 Commits

17 changed files with 105 additions and 47 deletions

View File

@ -3,5 +3,5 @@
Just a script to easily setup my shell environment on new devices.
```
git clone https://github.com/xlogerais/config-bootstrap.git ~/.bootstrap && cd ~/.bootstrap && bash bootstrap.bash
git clone https://gitea.logerais.com/xavier/config-bootstrap.git ~/.bootstrap && cd ~/.bootstrap && bash bootstrap.bash
```

View File

@ -1,6 +1,8 @@
#!/bin/bash
bash system-ubuntu.bash
bash tools.bash
bash fonts.bash
bash config.bash
BASEDIR=$(cd "$(dirname "$0")" && pwd)
bash "${BASEDIR}/os.bash"
bash "${BASEDIR}/tools.bash"
bash "${BASEDIR}/fonts.bash"
bash "${BASEDIR}/config.bash"

View File

@ -1,7 +1,7 @@
#!/bin/bash
for file in config.d/*.bash
do
bash $file
done
BASEDIR=$(cd "$(dirname "$0")" && pwd)
for file in "${BASEDIR}"/config.d/*.bash; do
bash "${file}"
done

View File

@ -4,6 +4,6 @@
if [[ ! -d ~/.bash ]]
then
git clone --recursive https://github.com/xlogerais/config-bash.git ~/.bash
git clone --recursive https://gitea.logerais.com/xavier/config-bash.git ~/.bash
bash ~/.bash/create-links.bash
fi

View File

@ -4,15 +4,26 @@
git config --global user.name "Xavier Logerais"
git config --global user.email "xavier@logerais.com"
git config --global rerere.enabled 1
git config --global credential.helper cache
git config --global merge.conflictstyle diff3
git config --global rerere.enabled 1
cat <<EOF >~/.gitignore
# asdf
### asdf ###
.tool-versions
# direnv
.envrc
### mise ###
.mise.toml
### direnv ###
.direnv
.envrc
### python ###
.venv
EOF
cat <<EOF >~/.gitattributes
EOF
git config --global core.excludesfile ~/.gitignore
git config --global core.attributesfile ~/.gitattributes

View File

@ -1,10 +1,17 @@
#!/bin/bash
# Configuration NVIM
# Configuration for neovim
if [[ ! -d ~/.config/nvim ]]
then
git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim
nvim +PackerSync
# git_repo="https://github.com/AstroNvim/template"
# git_branch="main"
git_repo="https://gitea.cloud.logerais.com/xavier/config-astronvim.git"
git_branch="main"
config_dir=${XDG_CONFIG_HOME:-$HOME/.config}/nvim
if [[ ! -d "${config_dir}" ]]; then
git clone "${git_repo}" --branch "${git_branch}" "${config_dir}"
nvim --headless +q
else
cd "${config_dir}" && git pull
fi

View File

@ -4,6 +4,6 @@
if [[ ! -d ~/.screen ]]
then
git clone --recursive https://github.com/xlogerais/config-screen.git ~/.screen
git clone --recursive https://gitea.logerais.com/xavier/config-screen.git ~/.screen
bash ~/.screen/create-links.bash
fi

View File

@ -1,9 +1,13 @@
#!/bin/bash
# Configuration TMUX
# Configuration for tmux
if [[ ! -d ~/.tmux ]]
then
git clone --recursive https://github.com/xlogerais/config-tmux.git ~/.tmux
bash ~/.tmux/create-links.bash
git_repo="https://gitea.cloud.logerais.com/xavier/config-tmux.git"
git_branch="master"
config_dir=${XDG_CONFIG_HOME:-$HOME/.config}/tmux
if [[ ! -d "${config_dir}" ]]; then
git clone "${git_repo}" --branch "${git_branch}" "${config_dir}"
else
cd "${config_dir}" && git pull
fi

View File

@ -4,7 +4,7 @@
if [[ ! -d ~/.vim ]]
then
git clone --recursive https://github.com/xlogerais/config-vim.git ~/.vim
git clone --recursive https://gitea.logerais.com/xavier/config-vim.git ~/.vim
bash ~/.vim/create-links.bash
fi

View File

@ -1,6 +1,6 @@
# FONTS
fontdir="$HOME/.local/share/fonts"
fontdir="${HOME}/.local/share/fonts"
declare -a fonts
fonts+=("Inconsolata")
@ -12,10 +12,9 @@ fonts+=("DejaVuSansMono")
test -d "${fontdir}" || mkdir -p "${fontdir}"
# Download fonts
for font in "${fonts[@]}"
do
wget -q -O /tmp/${font}.zip "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/${font}.zip" && cd ${fontdir} && unzip -u /tmp/${font}.zip && rm /tmp/${font}.zip
for font in "${fonts[@]}"; do
wget -q -O "/tmp/${font}.zip" "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/${font}.zip" && cd "${fontdir}" && unzip -u "/tmp/${font}.zip" && rm "/tmp/${font}.zip"
done
# Refresh cache
fc-cache --force --verbose ${fontdir}
fc-cache --force --verbose "${fontdir}"

7
os.bash Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
BASEDIR=$(cd "$(dirname "$0")" && pwd)
for file in "${BASEDIR}"/os.d/*.bash; do
bash "${file}"
done

View File

@ -1,10 +1,9 @@
#!/bin/bash
if ( grep -q Ubuntu <(lsb_release -i) )
then
if (grep -q Ubuntu <(lsb_release -i)); then
sudo apt update
sudo apt upgrade -y
sudo apt install -y coreutils grep less tar tree
sudo apt install -y man manpages-fr manpages-fr-extra
sudo apt install -y bash zsh fish

View File

@ -1,6 +1,7 @@
#!/bin/bash
for file in tools.d/*.bash
do
bash $file
BASEDIR=$(cd "$(dirname "$0")" && pwd)
for file in "${BASEDIR}"/tools.d/*.bash; do
bash "${file}"
done

View File

@ -19,15 +19,17 @@ tools+=(vault)
tools+=(terraform terragrunt)
tools+=(ripgrep exa bat dust delta)
for tool in "${tools[@]}"
do
echo
echo "-- Installing ${tool}"
asdf plugin add ${tool}
asdf install ${tool} latest
asdf global ${tool} latest
for tool in "${tools[@]}"; do
echo
echo "-- Installing ${tool}"
asdf plugin add ${tool}
asdf install ${tool} latest
asdf global ${tool} latest
done
# Configure asdf/direnv integration
asdf direnv setup --shell bash --version latest
# Install extra plugins and tools
# lsd

View File

@ -1,7 +1,18 @@
#!/bin/bash
# Install mise-en-place
# mise-en-place (https://mise.jdx.dev/)
if (command -v mise &>/dev/null); then
# Install
if (! command -v mise &>/dev/null); then
curl https://mise.run | sh
fi
if (command -v mise &>/dev/null); then
# Activate
eval "$(mise activate bash)"
mise settings set experimental true
# Install some plugins
(mise where usage &>/dev/null) || mise use -g usage # for completion
# mise use -g cargo:ubi # to install binaries from Github release
fi

15
tools.d/nix.bash Normal file
View File

@ -0,0 +1,15 @@
#!/bin/bash
# Install nix (with the nix-installer tool from DeterminateSystems)
# (See https://github.com/DeterminateSystems/nix-installer)
if ( ! command -v nix &> /dev/null ); then
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
fi
# Install home-manager
if (command -v nix-channel && command -v nix-shell &> /dev/null ); then
nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz home-manager
nix-channel --update
nix-shell '<home-manager>' -A install
fi