FONT=Lat2-Terminus16
KEYMAP=fr-bepo
gdisk /dev/sda
o # create new gpt partition table
n # create new partition
# choose 550M for the size
# type 0xEF00 = efi system partition
# /boot has type 0x8300 (linux fs)
# / has type 0x8E00 (linux lvm)
Check that correct kernel modules are loaded: lsmod | grep dm_crypt
and lsmod | grep dm_mod
.
# /dev/sda3 is the lvm partition
cryptsetup luksFormat -v -s 512 -h sha512 /dev/sda3
cryptsetup open /dev/sda3 luks_lvm
pvcreate /dev/mapper/luks_lvm
vgcreate arch /dev/mapper/luks_lvm
lvcreate -n swap -L 1G -C y arch
lvcreate -n root --extents 100%FREE arch
mkfs.fat -F32 /dev/sda1 # efi partition
mkfs.ext4 -L boot /dev/sda2 # boot partition
mkswap /dev/mapper/arch-swap
mkfs.ext4 -L root /dev/mapper/arch-root
swapon /dev/mapper/arch-swap
swapon -a ; swapon -s
mount /dev/mapper/arch-root /mnt
mkdir -p /mnt/boot
mount /dev/sda2 /mnt/boot
mkdir /mnt/boot/efi
mount /dev/sda1 /mnt/boot/efi
Set /etc/pacman.d/mirrorlist
correctly (closest mirrors on top) before proceeding.
pacstrap /mnt base base-devel linux linux-firmware grub efibootmgr vim networkmanager
genfstab -U /mnt >> /mnt/etc/fstab
Then arch-chroot /mnt /bin/bash
and follow the user guide until next step.
Configure mkinitcpio for luks (https://wiki.archlinux.org/index.php/Dm-crypt/System_configuration#mkinitcpio). Add keyboard sd-vconsole sd-encrypt lvm2
to the HOOKS
line in /etc/mkinitcpio.conf
. keyboard
should already be there. Also replace udev
with systemd
.
DEPRECATED now I use systemd-boot
Add to /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet rd.luks.name=<DEVICE_UUID>=cryptlvm root=/dev/arch/root"
To get the device uuid: ls -al /dev/disk/by-uuid/
. The DEVICE_UUID
is for the luks partition (/dev/sda3 here). arch
in root=/dev/arch/root
refers to the volume group used by lvm.
dd if=/dev/urandom of=/arch_luks_key.bin bs=512 count=10
chmod 000 /arch_luks_key.bin
chmod 600 /boot/initramfs-linux*
cryptsetup luksAddKey /dev/sda3 /arch_luks_key.bin
And add that to /etc/mkinitcpio.conf
: FILES=/arch_luks_key.bin
.
mkinitcpio -p linux
grub-install --efi-directory=/boot/efi
grub-mkconfig -o /boot/grub/grub.cfg
grub-mkconfig -o /boot/efi/EFI/arch/grub.cfg
Exit the chroot, unmount everything umount -R /mnt
and reboot
.
See this topic, need to add the following two things:
/etc/pam.d/nss-auth
#%PAM-1.0
session sufficient pam_unix.so
session sufficient pam_systemd_home.so
session required pam_deny.so
And add the following line (toward the end) in /etc/pam.d/system-auth
session required pam_limits.so
session substack nss-auth # <- THAT LINE!!!
session required pam_unix.so
session optional pam_permit.so
pacman -S zsh git tree neovim python-neovim htop fzf ripgrep alacritty fd hyperfine hexyl tokei
and some fonts:
pacman -S noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extra ttf-font-awesome ttf-inconsolata ttf-roboto
groupadd sudo useradd -m --groups sudo -s /bin/zsh greg
netctl list
and netctl enable <profile-name>
Once gpu driver and xorg are installed:
pacman -S i3-wm rofi i3status-rust
For desktop display config:
#!/usr/bin/env bash
if $(xrandr --query | grep "HDMI-0 connected" 2>&1 > /dev/null)
then
xrandr \
--output VGA-0 --off \
--output DVI-I-0 --off \
--output HDMI-0 --auto --left-of DVI-I-1 \
--output DVI-I-1 --primary --auto --rotate normal
else
xrandr \
--output VGA-0 --off \
--output DVI-I-0 --off \
--output HDMI-0 --off \
--output DVI-1-1 --primary --auto --rotate normal
fi
To put under /etc/X11/xorg.conf.d/10-keyboard.conf
.
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "fr,us"
Option "XkbVariant" "bepo,"
# the list of options is in /usr/share/X11/xkb/rules/base.lst
Option "XkbOptions" "grp:alt_caps_toggle"
EndSection
See SO
In ~/.config/systemd/user/ssh-agent.service
[Unit]
Description=SSH key agent
[Service]
Type=forking
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
ExecStart=/usr/bin/ssh-agent -a $SSH_AUTH_SOCK
[Install]
WantedBy=default.target
In ~/.pam_environment
: SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
. Then systemctl --user enable ssh-agent
, systemctl --user start ssh-agent
.
And in ~/.ssh/config
, add the line AddKeysToAgent yes
.
See IBus. sudo pacman -S ibus ibus-libpinyin
.
# in ~/.pam_environment
GTK_IM_MODULE=ibus
QT_IM_MODULE=ibus
XMODIFIERS=@im=ibus
Add ibus-daemon -drx
to ~/.xinitrc
.
For things not packaged yet, or in aur.