Bootstrap Script

Here will be presented what I do to get my system up and running on a fresh Arch Linux install. These installation instructions were written in order to get an Arch Linux distribution up and running with the same configuration as my main computer’s and my travelling laptop’s configuration.

Install Arch Linux

I usually install Arch from the vanilla ISOopen in new window, however I began using archfiopen in new window to install easily the distro (I’ve done it so many times, I know how it works now). Usually, my distros will be installed on two partitions: /home and / (root).

If the computer supports EFI bootloaders, the EFI partition will be mounted on /boot/efi. I generally use systemd-boot as my boot manager, but if you are more comfortable with another one, just install what you want. Be aware that if you format your /boot partition, you will delete all boot managers that already exist; so, if you are dual-booting, DO NOT FORMAT IT. Yes, I made the mistake of wiping the Windows boot manager when I used to dual-boot.

In order to use the suspend-then-hibernate systemd command, it is necessary to have a swap partition at least twice the size of your installed RAM. That is because when this command will be run, the system will try to save the current state of your machine, stored in your RAM, to the swap filesystem. If there is not enough space, the command will fail, and you won’t be able to use this command. For instance, my current computer has 32 GB of RAM, hence my SWAP partition is 16 GB large.

Get the latest, fastest mirrors

When you boot into the live ISO, execute the following command:

pacman -Sy reflector
reflector -c FR,DE -l 20 -p https --sort rate --save /etc/pacman.d/mirrorlist --verbose

This will update the packages from your live ISO, and you will get the best mirrors for your installation. Of course, change the countries accordingly to your location. In my case, I am only interested in French, German, and Belgian mirrors.

Install the system

Then you can use a custom script to ease your installation of Arch if you do not wish to do it manually. Personally, I’ve done it several times already, I know how the distro works, I just want to be able to install my distro quickly now. I’ll need to download the script with wget, but apparently it isn’t installed by default on Arch ISOs any more, so I’ll need to install it.

pacman -S wget

Now, let’s grab the script. You can check it on GitHubopen in new window.

wget archfi.sf.net/archfi
# Or from matmoul.github.io/archfi if SourceForge is down
sh archfi

Then, follow the instructions and install Arch Linux. Take the opportunity to install as many packages as you need, mainly paru which I use as my package manager (it is just a wrapper for pacman) and AUR helper, and pacman-contrib which will help us to install some packages later.

Once your system is installed, reboot and remove your installation media from your computer.

Execute bootstrap

The first thing I will do is add the Chaotic AURopen in new window repository to get access to paru as well as some AUR packages without the need of an AUR helper (ironic considering paru is one). We can then install fish, git, and paru:

sudo pacman -S fish git paru

And now that paru is available, we can install yadm:

paru -S yadm

yadm comes with a very handy feature: its bootstrap script. It can be executed automatically once the dotfiles are cloned with yadm:

yadm clone https://labs.phundrak.com/phundrak/dotfiles
# or if labs.phundrak.com is down or too slow for you
#yadm clone https://github.com/phundrak/dotfiles

Let’s take a look at what it does.

Decrypt private yadm files

Some private files are stored encrypted in the repository of my yadm dotfiles. I will need them later on during the bootstrap execution.

if test "$USER" = 'phundrak'
    yadm decrypt
else
    whiptail --yesno "Decrypt private files?" 8 40 && yadm decrypt
end

Get a correct keyboard layout

I use mainly the bépoopen in new window layout, a French keyboard layout inspired by Dvorak layouts, however I sometimes need to switch back to the standard French AZERTY or the American QWERTY layout, so I make it so the Menu key switches for me my layout between these three. This makes it so my Xorg configuration of my keyboard looks like this:

set keyboardconf \
'Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "fr"
        Option "XkbModel" "pc104"
        Option "XkbVariant" "bepo_afnor"
        Option "XkbOptions" "caps:ctrl_modifier"
EndSection'

So, let’s ask the user if they want to set it as their keyboard configuration.

printf "\n# Set keyboard layout #########################################################\n\n"
whiptail --yesno "Would you like to set your keyboard layout to the bépo layout?" 8 55
if test $status -eq 0
    echo $keyboardconf | sudo tee /etc/X11/xorg.conf.d/00-keyboard.conf
end

Set our locale

I use two main locales, the French and US UTF-8 locales, and I like to keep the Japanese locale activated just in case.

set mylocales "en_US.UTF-8 UTF-8" "fr_FR.UTF-8 UTF-8" "ja_JP.UTF-8 UTF-8"

I’ll let the user accept them one by one.

printf "\n# Set locale ##################################################################\n\n"
for item in $mylocales
    whiptail --yesno "Set the \"$item\" locale?" 8 40
    if test $status -eq 0 -a (grep -e "#$item" /etc/locale.gen)
        sudo sed -i "/$item/s/^#//g" /etc/locale.gen
    end
end

This is my configuration I usually use when it comes to my locale.

set localeconf "LANG=en_DK.UTF-8
LC_COLLATE=C
LC_NAME=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_MEASUREMENT=fr_FR.UTF-8"

Let’s set it as our system’s locale if the user wishes to.

whiptail --yesno "Do you agree to have the following locale set?\n\n     $localeconf"  20 43
if test $status -eq 0
    echo $localeconf | sudo tee /etc/locale.conf
end

Now we can generate our locale!

printf "\n# Generate locale #############################################################\n\n"
sudo locale-gen

Create some folders

Let’s create some folders we might need for mounting our drives, Android devices and CDs.

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}

Set user’s shell to fish

First, the bootstrap shell will set the user’s shell to fish.

printf "\n# Set fish as the default shell ###############################################\n\n"
whiptail --yesno "Set the current user’s default shell to fish?" 8 50
if test $status -eq 0 -a ! "$SHELL" = '/usr/bin/fish'
    chsh -s /usr/bin/fish
end

Install basic packages

OK, let’s list all the packages that I need. First, let’s begin with system packages.

Package nameWhy I need it
acpiBattery, power, and thermal readings
acpilightTo modify the monitors’ brightness
bluez-firmwareFirmware for my bluetooth device
bluez-utilsTo interact with bluez through custom tools
bzip2A compression algorithm and program
cpupowerExamine and tune power saving related features of the CPU
exfat-utilsUtilities for exFAT filesystems
ffmpegthumbnailerCreate thumbnails with ffmpeg
freeglutA small OpenGL library
gcc-libsRuntime libraries for GCC
gdbThe GCC debugger
gnome-disk-utilityTo manage easily my disks and partitions
gnome-epub-thumbnailerThumbnailer for Epub files
i3lock-colorMy screen locker
corrupter-gitA script for my script using also i3lock-color
inetutilsCommon network programs
jfsutilsJFS utilities to interact with Android
jmtpfsFUSE filesystem for the MTP protocol
kittyMy current terminal emulator, works with Xorg and Wayland
logrotateRotate system logs automatically
man-pagesLinux’s man pages
man-dbRead the Linux man pages
netctlProfile based systemd network management
network-manager-appletSystem tray applet for NetworkManager
networkmanager-openvpnConnect to OpenVPN servers with NetworkManager
nm-connection-editorManager NetworkManager connections
ntfs-3gUtilities to access NTFS filesystems
opensshSSH. Do I need to say anything more than that?
pavucontrolGraphical interface to PulseAudio settings
wireplumberSession manager for PipeWire
pipewire-pulsePipeWire replacement for pulseaudio and pulseaudio-bluetooth
gst-plugin-pipewirePipeWire plugin for GStreamer
noise-suppression-for-voiceRealtime noise suppression plugin for voice
raw-thumbnailerthumbnailer for RAW images
reflectorSort pacman mirrors
shadowPassword & account management tools
sshfsMount remote filesystems through SSH
usbutilsUSB utilities
xdg-user-dirs-gtkCreates user dirs and asks to relocalize them
xfce-polkitXFCE’s policy kit
xidlehookxautolock with extra features
xfsprogsAccess XFS filesystems
xorg-xinitxorg init program
xss-lockUse an external program as X lock screen
xwallpaperSet my Xorg session’s wallpaper

For development purposes, I need the following packages:

Package nameWhy I need it
asarPackage needed by some Electron programs
base-develMetapackage providing lots of basic tools for development
clangLLVM’s C/C++ compiler
cppcheckStatic code analysis for C/C++
cppreferenceThe cppreference wiki offline
cppreference-devhelpAccess cppreference through devhelp
dockerVMs are too heavy, get a better virtualization engine!
docker-composeDocker from the CLI? I prefer through a Yaml file.
dockerfile-language-server-binDockerfile LSP server
doxygenA great tool for writing code documentation for C/C++
emacsThe best text editor OS, hands down
farbfeldLossless image format
flake8Code checker for python
gnuplotAn awesome plotting tool
goThe Go programming language
go-toolsGo’s tooling
graphvizGraph visualization
hugoStatic website generator
javascript-typescript-langserverLSP server for Javascript
js-beautifyFormatter for Javascript
linux-headersDevelopment with the Linux kernel
lldbThe LLVM debugger
mesonMeson build system
mupdf-toolsTools for PDF and XPS viewers
npmJavascript package manager
pacman-contribCreate and install custom ArchLinux packages
pandoc-binConvert documents of various formats into other formats
prettierFormat various web files formats
python-autoflakeRemove unused imports and variables in Python
python-epcEPC (RPC stack for Emacs Lisp) for Python
python-importmagicAutomatically manage imports in Python
pyrightPython LSP server
python-noseA discovery-based test extension for Python
python-pipThe Python package manager
python-poetryPython dependency management and packaging made easy
python-ptvsdPython debugger
python-pytestPython testing suite
qemuMachine emulator and virtualizer
rThe R programming langugae
rustupThe Rust toolchain installer
sbclMy favorite CommonLisp implementation
typescriptBetter Javascript
typescript-language-server-binLSP server for Typescript
valgrindOur lord and saviour when writing C code
vscode-css-languageserver-binLSP server for CSS
vscode-html-languageserver-binLSP server for HTML
yaml-language-server-binLSP server for Yaml
zealOffline documentation browser

A couple of packages need to be installed to make LaTeX usable.

Package nameWhy I need it
biberA BibTex replacement, for citations in papers
mintedSyntax highlight for LaTeX
texlive-bibtexextraAdditional BibTeX styles and bibliography databases
texlive-fontsextraAll sorts of extra fonts
texlive-formatsextraCollection of extra TeX ‘formats’
texlive-humanitiesLaTeX packages for law, linguistics, social sciences, and humanities
texlive-langjapaneseFonts and macro packages to typeset Japanese texts
texlive-picturesPackages for drawings graphics
texlive-pstricksAdditional PSTricks packages
texlive-publishersLaTeX classes and packages for specific publishers
texlive-scienceTypesetting for mathematics, natural and computer sciences

Some visual packages:

Package nameWhy I need it
adobe-source-han-sans-jp-fontsJapanese fonts
inter-fontI’m not sure why I have these fonts
nordic-theme-gitNord theme for GTK
noto-fonts-emojiFont with emojis
otf-ipafontJapanese font
picomSee <picom.mdopen in new window>
powerline-fontsPowerline fonts
siji-gitSiji font
ttf-arphic-umingCJK font Ming style
ttf-baekmukKorean font
ttf-charis-silAPI font
ttf-dejavuDejaVu font
ttf-hanazonoJapanese kanji font
ttf-joypixelsEmoji font
ttf-koruriJapanese Truetype font
ttf-liberationLiberation font
ttf-monapoJapanese font
ttf-sazanamiJapanese fonts
ttf-unifontThe font I use in StumpWM
ttf-tibetan-machineTibetan font
unicode-emojiUnicode emoji data files

Terminal utilities

Package nameWhy I need it
asciiWork with ASCII
aspell-enAspell’s dictionary for English
aspell-frAspell’s dictionary for French
batA better cat with syntax highlighting
bitwarden-cliCLI application for my password manager
bpytopA very beautiful htop alternative
exaA great ls replacement
fdfind, but better
findutilsfind files on the system
fzfCommand-line fuzzy finder
htoptop, but better
isyncGives access to mbsync so I can check my mails
mpcDead simple MPD client
mpdMusic Player Daemon
mpvThe best video player in existance
nanoSimple text editor
ncduGraphical representation of disk usage
ncmpcppTUI for MPD
neofetchSystem info in the terminal
nordvpn-binConnect to NordVPN on Linux
numlockxTurn on the numpad in Xorg
p7zip7zip on Linux
passThe standard UNIX password manager
pdfpcPDF presentation tool in the console with multi-monitor support
ripgrepgrep but better
rsyncscp is dead, long live rsync!
flameshotTo take screenshots
tealdeertldr but faster, great cheatsheets in the terminal
tmuxTerminal multiplexer
treeSee files and directories as a tree
unrarSupport for rar file format
w3mTerminal web browser
wgetRetrieve files from the web
x11-ssh-askpassPassphrase dialogue over SSH
xclipInteract with the X11 clipboard
yt-dlp-drop-inyt-dlp but it also replaces youtube-dl

Let’s install some desktop applications too, shall we?

Package nameWhy I need it
bitwardenDesktop application for my password manager
discordFor messaging friends
firefoxBecause I need a good browser
gimpGIMP Is Mbetter than Photoshop
helvumPipewire patchbay
nemoOne of the best graphical file managers
nemo-filerollerAdd compression options to Nemo
nemo-previewQuick file previewer for Nemo
obs-studioSimply the best screen recording and streaming software
rofiA beautiful dmenu replacement

All these packages will be installed with the command paru -S --skipreview --needed to prevent it from nagging me about the PKGBUILD when I want to install something from the AUR, and if something is already installed it paru won’t try to reinstall it.

set SYSTEMPKG acpi \
acpilight \
bluez-firmware \
bluez-utils \
bzip2 \
cpupower \
exfat-utils \
ffmpegthumbnailer \
freeglut \
gcc-libs \
gdb \
gnome-disk-utility \
gnome-epub-thumbnailer \
i3lock-color \
corrupter-git \
inetutils \
jfsutils \
jmtpfs \
kitty \
logrotate \
man-pages \
man-db \
netctl \
network-manager-applet \
networkmanager-openvpn \
nm-connection-editor \
ntfs-3g \
openssh \
pavucontrol \
wireplumber \
pipewire-pulse \
gst-plugin-pipewire \
noise-suppression-for-voice \
raw-thumbnailer \
reflector \
shadow \
sshfs \
usbutils \
xdg-user-dirs-gtk \
xfce-polkit \
xidlehook \
xfsprogs \
xorg-xinit \
xss-lock \
xwallpaper

printf "\n# Installing SYSTEMPKG ##################################################\n\n"
for pkg in $SYSTEMPKG
    paru -S --skipreview --needed $pkg
end


set DEVELPKG asar \
base-devel \
clang \
cppcheck \
cppreference \
cppreference-devhelp \
docker \
docker-compose \
dockerfile-language-server-bin \
doxygen \
emacs \
farbfeld \
flake8 \
gnuplot \
go \
go-tools \
graphviz \
hugo \
javascript-typescript-langserver \
js-beautify \
linux-headers \
lldb \
meson \
mupdf-tools \
npm \
pacman-contrib \
pandoc-bin \
prettier \
python-autoflake \
python-epc \
python-importmagic \
pyright \
python-nose \
python-pip \
python-poetry \
python-ptvsd \
python-pytest \
qemu \
r \
rustup \
sbcl \
typescript \
typescript-language-server-bin \
valgrind \
vscode-css-languageserver-bin \
vscode-html-languageserver-bin \
yaml-language-server-bin \
zeal

printf "\n# Installing DEVELPKG ##################################################\n\n"
for pkg in $DEVELPKG
    paru -S --skipreview --needed $pkg
end


set LATEXPKG biber \
minted \
texlive-bibtexextra \
texlive-fontsextra \
texlive-formatsextra \
texlive-humanities \
texlive-langjapanese \
texlive-pictures \
texlive-pstricks \
texlive-publishers \
texlive-science

printf "\n# Installing LATEXPKG ##################################################\n\n"
for pkg in $LATEXPKG
    paru -S --skipreview --needed $pkg
end


set TERMINALPKG ascii \
aspell-en \
aspell-fr \
bat \
bitwarden-cli \
bpytop \
exa \
fd \
findutils \
fzf \
htop \
isync \
mpc \
mpd \
mpv \
nano \
ncdu \
ncmpcpp \
neofetch \
nordvpn-bin \
numlockx \
p7zip \
pass \
pdfpc \
ripgrep \
rsync \
flameshot \
tealdeer \
tmux \
tree \
unrar \
w3m \
wget \
x11-ssh-askpass \
xclip \
yt-dlp-drop-in

printf "\n# Installing TERMINALPKG ##################################################\n\n"
for pkg in $TERMINALPKG
    paru -S --skipreview --needed $pkg
end


set APPSPKG bitwarden \
discord \
firefox \
gimp \
helvum \
nemo \
nemo-fileroller \
nemo-preview \
obs-studio \
rofi

printf "\n# Installing APPSPKG ##################################################\n\n"
for pkg in $APPSPKG
    paru -S --skipreview --needed $pkg
end

Finally, I wish to install some custom packages for which I’ve written a PKGBUILD file myself. I store all of them in a dedicated directory located in $HOME/Documents/code/PKGBUILDs. I want to install some of them immediately.

Package NameWhat it is
emacsMy custom Emacs build, it will replace the one already installed
nsxivThe best image viewer after Emacs
pumopm-gitMy very simple battery manager
sentA very simple presentation tool

Tangle configuration files from Org files

Before tangling our configuration files, we need to create some directories first to make sure our files can be properly tangled. Here’s the list of directories we need to create:

| $HOME/.config/fish | | $HOME/.config/gtk-2.0 | | $HOME/.config/gtk-3.0 | | $HOME/.config/ncmpcpp | | $HOME/.config/neofetch | | $HOME/.config/picom | | $HOME/.config/yadm | | $HOME/.local/bin | | $HOME/.stumpwm.d | | $HOME/org/capture |

Our code to generate such directories looks like this:

mkdir -p $HOME/.config/fish
mkdir -p $HOME/.config/gtk-2.0
mkdir -p $HOME/.config/gtk-3.0
mkdir -p $HOME/.config/ncmpcpp
mkdir -p $HOME/.config/neofetch
mkdir -p $HOME/.config/picom
mkdir -p $HOME/.config/yadm
mkdir -p $HOME/.local/bin
mkdir -p $HOME/.stumpwm.d
mkdir -p $HOME/org/capture

The next step is to tangle all the Org files. Here is the list of files that are to be tangled:

filename
bin.orgopen in new window
emacs.orgopen in new window
fish.orgopen in new window
index.orgopen in new window
mpd.orgopen in new window
neofetch.orgopen in new window
picom.orgopen in new window
rustfmt.orgopen in new window
stumpwm.orgopen in new window
tmux.orgopen in new window
printf "\n# Tangling org files ##########################################################\n\n"
printf '\n\n==== Tangling bin.org\n\n' && \
emacs -q --batch --eval '(require \'ob-tangle)' \
--eval '(setq org-confirm-babel-evaluate nil)' \
--eval '(org-babel-tangle-file "~/org/config/bin.org")'

printf '\n\n==== Tangling emacs.org\n\n' && \
emacs -q --batch --eval '(require \'ob-tangle)' \
--eval '(setq org-confirm-babel-evaluate nil)' \
--eval '(org-babel-tangle-file "~/org/config/emacs.org")'

printf '\n\n==== Tangling fish.org\n\n' && \
emacs -q --batch --eval '(require \'ob-tangle)' \
--eval '(setq org-confirm-babel-evaluate nil)' \
--eval '(org-babel-tangle-file "~/org/config/fish.org")'

printf '\n\n==== Tangling index.org\n\n' && \
emacs -q --batch --eval '(require \'ob-tangle)' \
--eval '(setq org-confirm-babel-evaluate nil)' \
--eval '(org-babel-tangle-file "~/org/config/index.org")'

printf '\n\n==== Tangling mpd.org\n\n' && \
emacs -q --batch --eval '(require \'ob-tangle)' \
--eval '(setq org-confirm-babel-evaluate nil)' \
--eval '(org-babel-tangle-file "~/org/config/mpd.org")'

printf '\n\n==== Tangling neofetch.org\n\n' && \
emacs -q --batch --eval '(require \'ob-tangle)' \
--eval '(setq org-confirm-babel-evaluate nil)' \
--eval '(org-babel-tangle-file "~/org/config/neofetch.org")'

printf '\n\n==== Tangling picom.org\n\n' && \
emacs -q --batch --eval '(require \'ob-tangle)' \
--eval '(setq org-confirm-babel-evaluate nil)' \
--eval '(org-babel-tangle-file "~/org/config/picom.org")'

printf '\n\n==== Tangling rustfmt.org\n\n' && \
emacs -q --batch --eval '(require \'ob-tangle)' \
--eval '(setq org-confirm-babel-evaluate nil)' \
--eval '(org-babel-tangle-file "~/org/config/rustfmt.org")'

printf '\n\n==== Tangling stumpwm.org\n\n' && \
emacs -q --batch --eval '(require \'ob-tangle)' \
--eval '(setq org-confirm-babel-evaluate nil)' \
--eval '(org-babel-tangle-file "~/org/config/stumpwm.org")'

printf '\n\n==== Tangling tmux.org\n\n' && \
emacs -q --batch --eval '(require \'ob-tangle)' \
--eval '(setq org-confirm-babel-evaluate nil)' \
--eval '(org-babel-tangle-file "~/org/config/tmux.org")'

Set up dotfiles’ git repository

Update our dotfiles’ remotes

This line in the bootstrap script will test if the current user is using my username. If yes, it’s probably me.

if test "$USER" = 'phundrak'

If it is me installing and using these dotfiles, I want the remotes of my dotfiles to be set to ssh remotes using my ssh keys.

printf "\n# Update yadm’s remotes #######################################################\n\n"
yadm remote set-url origin git@labs.phundrak.com:phundrak/dotfiles.git

I will also want to decrypt my encrypted files, such as said ssh keys.

printf "\n# Decrypt encrypted dotfiles ##################################################\n\n"
yadm decrypt

Finally, let’s close this if statement.

end

Update our submodules

Now we can download the various dependencies of our dotfiles. To do so, let’s run the following command:

printf "\n# Getting yadm susbmodules ####################################################\n\n"
yadm submodule update --init --recursive

Enable some services

We have installed some packages which require some services to run. Let’s enable them.

Systemd-timesyncd

This service enables time syncing with the NTP protocol, so I can be sure my computer’s time is correct. The service first needs to be enabled:

printf "\n# Enabling timesync ###########################################################\n\n"
sudo systemctl enable --now systemd-timesyncd

Now, let systemd know I want to use the NTP protocol to keep my computer’s time synced.

sudo timedatectl set-ntp true

Acpilight

acpilight is our utility managing the brightness of our screen. There is actually no service to enable here, but we must ensure the user is part of the video group to enable the user modifying the brightness of our screen without using sudo.

sudo usermod -aG video $USER

Docker

First, let’s activate Docker on startup.

printf "\n# Enabling and starting Docker ################################################\n\n"
sudo systemctl enable --now docker

Now, if we wish it, we can add ourselves to the docker group to avoid typing sudo each time we call Docker or Docker Compose.

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

Emacs

Emacs will run as a user service, which means it won’t be launched until we log in. However, the service won’t be started immediately, I personally prefer to start a standalone instance in which installing and compiling the Emacs packages will happen, and then once that is done I will start the service.

printf "\n# Enabling Emacs as user service ##############################################\n\n"
systemctl --user enable emacs

I don’t want to activate it immediately however, since the first startup might require some interactivity with the main Emacs frame, not with emacsclient. When Emacs will be ready, its service can be started like so (command not tangled in the bootstrap):

systemctl --user start emacs

Mpd

Mpd will also use as a user service in order to get rid of some lines of code in my configuration.

printf "\n# Enabling Mpd as a user service ##############################################\n\n"
mkdir -p ~/.config/mpd/playlists
systemctl --user enable --now mpd

NordVPN

Thanks to the AUR package nordvpn-bin, I no longer have to manually maintain my VPN connections with OpenVPN. However, it requires a service that we should activate:

sudo systemctl enable --now nordvpnd

Let’s also set its default protocol to UDP. This will allow me to use any port while connected to any Wi-Fi as long as the 443 port is available. Because yes, I do connect to a Wi-Fi that blocks some important ports, such as the IMAP and SMTP ports. Thanks University of Paris 8 for being SO paranoid.

nordvpn s protocol tcp

Note that this change in protocol is only valid when using the OpenVPN technology. If we want to use the Wireguard technology through Project NordLynxopen in new window, this option will no longer be available. To set NordVPN to use WireGuard, we can run this command (not tangled in the bootstrap).

nordvpn set technology NordLynx

Why WireGuard? Well, it can achieve better performances than OpenVPN with physically nearby servers, and according to this articleopen in new window the former can be more than half as fast as the latter. It is also much more auditable than OpenVPN (only a few thousands lines of code against some hundred of thousands). Oh, and WireGuard is part of the Linux kernel since its version 5.6. And Windows’ since August 2021, but I don’t really care about Windows.

But, WireGuard is less privacy-oriented than OpenVPN. So, if I ever need to use my VPN for privacy reasons, I can simply revert to the OpenVPN technology like shown with this command (not tangled in the bootstrap):

nordvpn set technology OpenVPN

Finally, I want to be notified of NordVPN’s actions, and I want to be able to use IPv6.

nordvpn set notify enabled
nordvpn set ipv6 enabled

PipeWire

PipeWire is a replacement for PulseAudio, ALSA and the likes, and it is much better in terms of security and performance. However, unlike PulseAudio, Pipewire is a user service that needs to be enabled per user.

systemctl --user enable --now pipewire-pulse.service

I also installed noise-suppression-for-voice which is a plugin usable by PipeWire to remove all noise the microphone might record save for the voice. It is damn effective, and it can be activated as a user service! In fact, I have in my dotfiles the service saved, so let’s activate it right away:

systemctl --user enable --now pipewire-input-filter-chain.service

Just make sure afterwards the microphone is redirected to the noise-canceling source. The same source should be your input device where you want to use your microphone. The only downside is this is only a mono input, but it shouldn’t matter for most people.

SSH server

Maybe we want to activate an SSH server on our machine. If so, we can enable it. Let’s ask the question.

whiptail --yesno 'Do you want to activate the ssh server?' 8 50
if test $status -eq 0
    printf "\n# Enabling ssh server #########################################################\n\n"
    sudo systemctl enable --now sshd
end

Let’s symlink the plock script (source here) to /usr/bin so xss-lock can find it.

sudo ln -s ~/.local/bin/plock /usr/bin/plock

Install packages from git

Now, let’s install some packages from git directly.

mkdir -p ~/fromGIT

Reveal.JS

I sometimes use Reveal.JS to make presentations, and I set its location in my Emacs config to be in ~/fromGIT, so let’s clone it there.

printf "\n# Install Reveal.JS ###########################################################\n\n"
cd ~/fromGIT
git clone https://github.com/hakimel/reveal.js.git

Install Rust

Install the toolchains

When using Rust, I bounce between two toolchains, the stable toolchain and the nightly toolchain, although I try to stick with Rust Stable. To install them, I will use rustup which has already been installed previously.

printf "\n# Install the rust toolchains, nightly is the default one #####################\n\n"
rustup default stable

This will both download the stable toolchain and set it as the default one. Now to install the nightly toolchain, let’s run this:

rustup toolchain install nightly

Install some utilities

We’ll need some utilities when developing Rust from Emacs, namely rustfmt. Let’s install it with cargo.

printf "\n# Add rust utilities ##########################################################\n\n"
cargo install rustfmt

We will also need some components for development purposes.

ComponentWhy
rust-srcRust documentation in Emacs
clippyA better version of cargo’s check command

Here is the code to do so:

rustup component add rust-src
rustup component add clippy

Set up our fish shell

The last thing we want to do is to set up our fish shell with some extensions in order to improve the user experience.

Install fisher

We will be using fisher as our extension manager for Fish. Let’s install it.

printf "\n# Installing fisher ###########################################################\n\n"
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher

Install our extensions

I generally use the following extensions in my Fish shell.

Package nameDescription
decors/fish-colored-manColor man pages to make them more readable
franciscolourenco/doneAutomatically receive notifications when a long process finishes
jethrokuan/fzfImproved key bindings for junegunn/fzfopen in new window
jorgebucaran/fish-baxRun bash scripts, replaying environment changes in fish
jorgebucaran/fish-getoptsCLI options parser; alternative to the argparseopen in new window fish builtin
laughedelic/piscesAutoclose parentheses, braces, quotes and other paired symbols
printf "\n# Installing Fisher Extensions ################################################\n\n"
fisher install decors/fish-colored-man
fisher install franciscolourenco/done
fisher install jethrokuan/fzf
fisher install jorgebucaran/fish-bax
fisher install jorgebucaran/fish-getopts
fisher install laughedelic/pisces