2022-09-30 03:23:30 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-11-06 15:57:25 +01:00
|
|
|
set -o errexit # crash the script when a command crash
|
2023-03-12 21:05:37 +01:00
|
|
|
set -o pipefail # same as above for piped command
|
2022-11-06 15:57:25 +01:00
|
|
|
set -o nounset # crash when a variable doesnt exist
|
|
|
|
|
|
|
|
# TRACE=1 for debug
|
|
|
|
if [[ "${TRACE-0}" == "1" ]]; then
|
2023-09-13 11:51:35 +02:00
|
|
|
set -o xtrace
|
2022-11-06 15:57:25 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
cd "$(dirname "$0")" # change script directory
|
|
|
|
|
2024-03-30 17:50:32 +01:00
|
|
|
function main {
|
2024-03-30 17:27:51 +01:00
|
|
|
# === Variables ==
|
2023-09-13 22:37:04 +02:00
|
|
|
local repo
|
|
|
|
repo=https://git.mylloon.fr/Anri/confOS/raw/branch/main
|
|
|
|
|
2024-03-30 17:27:51 +01:00
|
|
|
|
2023-09-13 11:51:35 +02:00
|
|
|
# === Init pacman ==
|
|
|
|
sudo pacman-key --init
|
|
|
|
sudo pacman-key --populate
|
|
|
|
sudo pacman -Sy --noconfirm archlinux-keyring
|
|
|
|
|
|
|
|
|
|
|
|
# === Update Arch ==
|
|
|
|
sudo pacman -Syyuu --noconfirm
|
|
|
|
|
2024-03-30 17:27:51 +01:00
|
|
|
|
2023-09-13 11:51:35 +02:00
|
|
|
# === Install packages ==
|
|
|
|
sudo pacman -S --noconfirm \
|
2023-09-13 22:45:51 +02:00
|
|
|
git wget zip openssh bat base-devel make python-pygments micro git-lfs npm \
|
|
|
|
sdl2_image nodejs fish autoconf valgrind automake python-virtualenv gdb \
|
|
|
|
tk sdl2_mixer eza fzf glu man-pages-fr uwufetch mdcat python-pip opam \
|
2023-10-23 18:35:24 +02:00
|
|
|
cpanminus unison timidity++ rebuild-detector difftastic sdl2_ttf rustup \
|
2023-11-05 16:57:53 +01:00
|
|
|
libsamplerate rsync doxygen otf-fira-sans ttf-fira-code texlive-binextra \
|
2023-09-13 22:45:51 +02:00
|
|
|
otf-fira-mono mingw-w64-gcc otf-font-awesome soundfont-fluid fluidsynth \
|
|
|
|
pulseaudio-alsa texlive-latexextra texlive-langfrench texlive-luatex \
|
2023-12-11 12:39:17 +01:00
|
|
|
noto-fonts jdk-openjdk texlive-fontsrecommended texlive-publishers sfml \
|
2024-03-11 09:44:07 +01:00
|
|
|
texlive-fontsextra perl-yaml-tiny perl-file-homedir perl-file-which \
|
2024-04-11 19:21:49 +02:00
|
|
|
man-pages bottom maven
|
2023-09-13 11:51:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
# === Remove SU password ==
|
2023-12-19 15:21:51 +01:00
|
|
|
echo -e "\n# Disable password for specific user\n$USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers > /dev/null
|
2023-09-13 11:51:35 +02:00
|
|
|
|
|
|
|
|
2024-04-08 20:26:41 +02:00
|
|
|
# === Global OS configuration set-up ==
|
|
|
|
curl ${repo}/meta.sh -s | bash -s -- ${repo}
|
|
|
|
|
|
|
|
|
2023-09-13 11:51:35 +02:00
|
|
|
# === AUR packages ==
|
2023-09-13 13:13:26 +02:00
|
|
|
paru -S --noconfirm \
|
2024-03-30 17:27:51 +01:00
|
|
|
otf-font-awesome
|
2023-09-13 11:51:35 +02:00
|
|
|
|
|
|
|
|
2024-03-30 17:27:51 +01:00
|
|
|
# === Set-up systemd ==
|
2023-11-05 21:28:47 +01:00
|
|
|
mkdir -p subsystemctl
|
2023-09-13 11:51:35 +02:00
|
|
|
cd subsystemctl || exit
|
|
|
|
curl -so PKGBUILD https://raw.githubusercontent.com/sorah/arch.sorah.jp/master/aur-sorah/PKGBUILDs/subsystemctl/PKGBUILD
|
|
|
|
makepkg -si --noconfirm
|
|
|
|
cd ..
|
2023-11-05 21:32:41 +01:00
|
|
|
rm -rf subsystemctl ||:
|
2023-09-13 11:51:35 +02:00
|
|
|
sudo subsystemctl start
|
|
|
|
|
2024-03-30 17:27:51 +01:00
|
|
|
|
2023-09-13 11:51:35 +02:00
|
|
|
# === Locales ==
|
|
|
|
sudo sed -i "s/#fr_FR.UTF-8 UTF-8/fr_FR.UTF8 UTF-8/g" /etc/locale.gen
|
|
|
|
sudo locale-gen
|
2024-04-08 21:35:48 +02:00
|
|
|
sudo subsystemctl stop; sudo subsystemctl start # fix weird bug
|
2023-09-13 11:51:35 +02:00
|
|
|
subsystemctl exec sudo localectl set-locale fr_FR.UTF-8
|
|
|
|
|
2024-03-30 17:27:51 +01:00
|
|
|
|
2023-09-13 11:51:35 +02:00
|
|
|
# === Shared folders ==
|
2023-11-05 21:28:47 +01:00
|
|
|
sudo mkdir -p /mnt/y
|
2024-04-15 16:00:05 +02:00
|
|
|
sudo mkdir -p /mnt/z
|
2023-09-13 11:51:35 +02:00
|
|
|
|
2024-03-30 17:27:51 +01:00
|
|
|
|
2023-09-13 11:51:35 +02:00
|
|
|
# === Fish ==
|
2024-03-30 17:27:51 +01:00
|
|
|
# Custom WSL configuration
|
2024-03-30 17:50:32 +01:00
|
|
|
curl -s ${repo}/.config/fish/config_wsl.fish >> "$HOME"/.config/fish/config.fish
|
2023-09-13 22:37:04 +02:00
|
|
|
curl -s ${repo}/.config/fish/conf.d/abbr_wsl.fish >> "$HOME"/.config/fish/conf.d/abbr.fish
|
2023-11-15 09:58:58 +01:00
|
|
|
curl -s ${repo}/.config/fish/conf.d/alias_wsl.fish >> "$HOME"/.config/fish/conf.d/alias.fish
|
2024-04-08 21:38:19 +02:00
|
|
|
# Specific WSL functions
|
2024-04-08 21:38:52 +02:00
|
|
|
#wget -q "${repo}"/.config/fish/functions/trash.fish -P "$HOME"/.config/fish/functions/
|
2023-09-13 11:51:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
# === OCaml ==
|
|
|
|
# Fix dlllwt_unix_stubs.so shared object file
|
|
|
|
fish -c "set -Ux CAML_LD_LIBRARY_PATH $(opam var stublibs)"
|
|
|
|
|
|
|
|
|
|
|
|
# === Valgrind ==
|
|
|
|
fish -c "set -Ux DEBUGINFOD_URLS https://debuginfod.archlinux.org"
|
|
|
|
|
2024-03-30 17:27:51 +01:00
|
|
|
|
2023-09-13 11:51:35 +02:00
|
|
|
# === Unison ==
|
2023-11-05 21:28:47 +01:00
|
|
|
mkdir -p "$HOME"/.unison
|
2023-09-13 22:37:04 +02:00
|
|
|
wget -q ${repo}/.unison/default.prf -O "$HOME"/.unison/default.prf
|
2023-09-13 11:51:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
# === Bash VSCode fix ==
|
2023-09-13 22:37:04 +02:00
|
|
|
curl -s ${repo}/dotfiles/.bashrc >> "$HOME"/.bashrc
|
2023-09-13 11:51:35 +02:00
|
|
|
|
|
|
|
|
2024-03-30 17:27:51 +01:00
|
|
|
# === Clear useless packages ==
|
2024-04-08 21:57:48 +02:00
|
|
|
fish -c "pacman-clean"
|
|
|
|
paru --noconfirm -Rsndd \
|
2024-04-08 21:58:07 +02:00
|
|
|
subsystemctl fakeroot-tcp
|
2023-09-13 11:51:35 +02:00
|
|
|
|
|
|
|
echo -e "\nInstallation terminée !\nIl faut redémarrer WSL (dans Powershell = wsl --shutdown)."
|
|
|
|
echo -e "---\nPense bien à paramétrer ton terminal, exemple avec Windows Terminal :"
|
|
|
|
echo "- Ligne de commande = wsl.exe -d Arch fish"
|
|
|
|
echo "- Profils par défaut => Apparence :"
|
|
|
|
echo " - Jeu de couleur = One Half Dark"
|
|
|
|
echo " - Type de police = Caskaydia Cove Nerd Font Complete Mono Windows Compatible"
|
|
|
|
echo " (à télécharger ici : https://www.nerdfonts.com/font-downloads)"
|
2022-11-06 15:57:25 +01:00
|
|
|
}
|
2022-09-30 03:23:30 +02:00
|
|
|
|
2022-11-06 15:57:25 +01:00
|
|
|
if grep "WSL2" /proc/version > /dev/null;
|
|
|
|
then
|
2023-09-13 11:51:35 +02:00
|
|
|
main "$@"
|
2022-09-30 03:23:30 +02:00
|
|
|
else
|
2023-09-13 11:51:35 +02:00
|
|
|
echo "Ce script ne fonctionne que sur ArchWSL." >&2
|
2022-09-30 03:23:30 +02:00
|
|
|
fi
|