dotfiles/.yadm/bootstrap

197 lines
7.8 KiB
Plaintext
Raw Normal View History

2019-10-14 19:11:32 +00:00
#!/usr/bin/fish
# -*- mode: fish -*-
set keyboardconf \
'Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "fr,fr,us"
Option "XkbModel" "pc104"
Option "XkbVariant" "bepo,,"
Option "XkbOptions" "grp:menu_toggle"
EndSection'
printf "\n# Set keyboard layout #########################################################\n\n"
echo $keyboardconf | sudo tee /etc/X11/xorg.conf.d/00-keyboard.conf
set mylocales "en_US.UTF-8 UTF-8" "fr_FR.UTF-8 UTF-8" "ja_JP.UTF-8 UTF-8"
printf "\n# Set our locale ##############################################################\n\n"
for item in $mylocales
if test (grep -e "#$item" /etc/locale.gen)
sudo sed -i "/$item/s/^#//g" /etc/locale.gen
end
end
set localeconf "LANG=en_US.UTF-8
LC_COLLATE=C
LC_NAME=fr_FR.UTF-8
LC_NUMERIC=fr_FR.UTF-8
LC_IDENTIFICATION=fr_FR.UTF-8
LC_TELEPHONE=fr_FR.UTF-8
LC_MONETARY=fr_FR.UTF-8
LC_PAPER=fr_FR.UTF-8
LC_ADDRESS=fr_FR.UTF-8
LC_TIME=fr_FR.UTF-8
LC_MEASUREMENT=fr_FR.UTF-8"
echo $localeconf | sudo tee /etc/locale.conf
printf "\n# Generate locale #############################################################\n\n"
sudo locale-gen
printf "\n# Create directories for mounting #############################################\n\n"
sudo mkdir -p /mnt/{USB,CD,Android}
sudo chown $USER:(id -g $USER) /mnt/{USB,CD,Android}
2019-10-14 19:11:32 +00:00
printf "\n# Set fish as the default shell ###############################################\n\n"
chsh -s /usr/bin/fish
2019-10-14 19:11:32 +00:00
if ! test which yay
printf "\n# Installing yay ##############################################################\n\n"
2019-10-14 19:11:32 +00:00
cd
mkdir -p fromGIT
cd fromGIT
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si --noconfirm
else
printf "\n# yay already installed #######################################################\n\n"
2019-10-14 19:11:32 +00:00
end
printf "\n# Installing Spacemacs ########################################################\n\n"
rm -rf ~/.emacs.d
2019-10-14 19:11:32 +00:00
git clone --single-branch --branch develop https://github.com/syl20bnr/spacemacs ~/.emacs.d
2019-10-14 19:11:32 +00:00
yadm checkout -- ~/.emacs.d/private/
2019-10-14 19:11:32 +00:00
2019-10-14 19:18:35 +00:00
if ! test (echo "phundrak" | sed -e "s/^.*$USER//I")
printf "\n# Update yadms remotes #######################################################\n\n"
yadm remote set-url origin git@labs.phundrak.fr:phundrak/dotfiles.git
yadm remote add github git@github.com:phundrak/dotfiles.git
printf "\n# Decrypt encrypted dotfiles ##################################################\n\n"
yadm decrypt
2019-10-14 19:18:35 +00:00
end
printf '\n# Install envtpl ##############################################################\n\n'
yay -Syu python-envtpl-git
printf "\n# Getting yadm susbmodules ####################################################\n\n"
yadm submodule update --init --recursive
printf "\n# Generating alt files ########################################################\n\n"
2019-10-14 19:11:32 +00:00
yadm alt
for f in (find ~/etc -type f)
set dest (echo $f | sed -n 's/^.*etc\(.*\)$/\/etc\1/p')
sudo ln -s $f $dest
end
read --prompt "echo 'Symlink .nanorc to roots .nanorc? (Y/n): ' " -l nanoroot
if test $nanoroot = 'y' || test $nanoroot = "Y" || test $nanoroot = ''
printf "\n# Symlinking .nanorc to roots .nanorc ########################################\n\n"
sudo ln -s $HOME/.nanorc /root/.nanorc
end
set PACKAGES \
asar ascii aspell-en aspell-fr assimp awesome-terminal-fonts base-devel bat \
biber bleachbit bluez-firmware bluez-utils bookworm boost bzip2 chromium clisp \
2019-10-21 01:08:08 +00:00
clight compton cppcheck cppreference cppreference-devhelp cpupower cronie \
cryptsetup device-mapper diffutils discord-canary discount ditaa dmenu \
dmenu-lpass docker docker-compose doxygen dunst dwarffortress emacs \
exfat-utils ffmpegthumbnailer findutils firefox flake8 font-mathematica \
fontforge freeglut fzf gcc-libs gdb gimp glibc gnome-disk-utility \
gnome-epub-thumbnailer gnu-free-fonts gnuplot go-tools graphviz htop i3-gaps \
i3lock-blur i3status igdm-bin inetutils j4-dmenu-desktop jfsutils jmtpfs \
lastpass-cli less linux-headers lldb logrotate lvm2 ly-git meson minted mpc \
mpd mpd-rich-presence-discord-git mpv mupdf-tools nano ncdu ncmpcpp \
nemo-fileroller nemo-preview neofetch netctl networkmanager \
networkmanager-openvpn nm-connection-editor nnn nomacs noto-fonts-emoji npm \
ntfs-3g numlockx openssh p7zip pacman-contrib pandoc-bin pavucontrol pciutils \
pcurses pdfpc polybar pulseaudio-bluetooth python-envtpl-git python-pip \
python-pywal qemu r raw-thumbnailer reflector rofi rofi-wifi-menu-git rsync \
rtv rustup s-nail samba scrot sent shadow siji-git simplescreenrecorder \
2019-10-21 07:06:01 +00:00
speedcrunch sshfs st-luke-git swi-prolog texlive-bibtexextra texlive-bin \
texlive-core texlive-fontsextra texlive-formatsextra texlive-games \
texlive-humanities texlive-langchinese texlive-langcyrillic texlive-langextra \
texlive-langgreek texlive-langjapanese texlive-langkorean texlive-latexextra \
2019-10-21 01:08:08 +00:00
texlive-localmanager-git texlive-music texlive-pictures texlive-pstricks \
texlive-publishers texlive-science tmux tree ttf-arphic-uming ttf-baekmuk \
ttf-bitstream-vera ttf-dejavu ttf-google-fonts-opinionated-git ttf-joypixels \
ttf-liberation ttf-material-design-icons-git ttf-ms-fonts ttf-symbola \
ttf-tibetan-machine ttf-twemoji-color ttf-unifont unicode unicode-emoji unrar \
usbutils valgrind vim w3m wget x11-ssh-askpass xclip xdg-user-dirs-gtk \
xorg-drivers xorg-apps xfsprogs xorg-server xorg-xinit xss-lock yapf
printf "\n# Installing needed packages ##################################################\n\n"
yay -S --needed $PACKAGES
2019-10-14 19:11:32 +00:00
printf "\n# Installing tryones compton fork ############################################\n\n"
2019-10-14 19:11:32 +00:00
yay -S compton-tryone-git
printf "\n# Enabling and starting Docker ################################################\n\n"
2019-10-14 19:11:32 +00:00
sudo systemctl enable --now docker
read --prompt "echo 'Do you wish to be added to the `docker` group? (Y/n): ' " -l adddockergroup
if test $adddockergroup = 'y' || test $adddockergroup = "Y" || test $adddockergroup = ''
sudo usermod -aG docker $USER
end
printf "\n# Enabling Emacs as user service ##############################################\n\n"
2019-10-14 19:11:32 +00:00
systemctl --user enable --now emacs
2019-10-14 19:50:06 +00:00
read --prompt "echo 'Do you want to activate the ssh server? (Y/n): ' " -l sshdserver
if test $sshdserver = 'y' || test $sshdserver = "Y" || test $sshdserver = ''
printf "\n# Enabling ssh server #########################################################\n\n"
2019-10-14 19:11:32 +00:00
sudo systemctl enable --now sshd
end
printf "\n# Installing fisher ###########################################################\n\n"
2019-10-14 19:11:32 +00:00
curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish
set FISHEXTENSIONS \
edc/bass franciscolourenco/done jethrokuan/fzf jethrokuan/z \
jorgebucaran/fish-getopts laughedelic/pisces matchai/spacefish \
tuvistavie/fish-ssh-agent
fisher add $FISHEXTENSIONS
2019-10-14 19:11:32 +00:00
printf "\n# Install i3-gaps-rounded #####################################################\n\n"
2019-10-14 19:11:32 +00:00
cd ~/fromGIT
git clone https://github.com/resloved/i3.git i3-gaps-rounded
cd i3-gaps-rounded
rm -rf build
autoreconf --force --install
mkdir build && cd build
../configure --prefix=/usr --sysconfdir=/etc --disable-sanitizers
make -j
2019-10-14 19:11:32 +00:00
sudo make install
printf "\n# Install polybar-battery #####################################################\n\n"
2019-10-14 19:11:32 +00:00
cd ~/fromGIT
git clone https://github.com/drdeimos/polybar_another_battery.git
cd polybar_another_battery
go get -u github.com/distatus/battery/cmd/battery
make build
ln -s polybar-ab ~/.local/bin/polybar-ab
printf "\n# Install Reveal.JS ###########################################################\n\n"
2019-10-14 19:11:32 +00:00
cd ~/fromGIT
git clone https://github.com/hakimel/reveal.js.git
printf "\n# Install the rust toolchains, nightly is the default one #####################\n\n"
2019-10-14 19:11:32 +00:00
rustup default nightly
2019-10-14 19:11:32 +00:00
rustup toolchain install stable
printf "\n# Add rust utilities ##########################################################\n\n"
2019-10-14 19:11:32 +00:00
cargo install rustfmt racer
printf "\n# Clean the pacman and yay cache ##############################################\n\n"
yay -Sc --noconfirm