Skip to content

Instantly share code, notes, and snippets.

@PIPIPIG233666
Last active February 5, 2020 00:37
Show Gist options
  • Save PIPIPIG233666/5da24cc34f5990346374103f64ea30b4 to your computer and use it in GitHub Desktop.
Save PIPIPIG233666/5da24cc34f5990346374103f64ea30b4 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
sed -i -e 's/^#\(en_US\|zh_CN\)\(\.UTF-8\)/\1\2/g' /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
ln -sf /usr/share/zoneinfo/Asia/New_York /etc/localtime
hwclock --systohc
systemctl enable systemd-timesyncd
export HOSTNAME="Pig"
echo $HOSTNAME > /etc/hostname
sed -ie "8i 127.0.1.1\t$HOSTNAME.localdomain\t$HOSTNAME" /etc/hosts
pacman -Ss /mnt base base-devel linux \
intel-ucode \ # cpu
zsh tmux git openssh rsync sshfs neovim gvim \
python python-pip python-neovim xclip \
htop exa ripgrep fd-rs \
nodejs npm yarn \
noto-fonts noto-fonts-cjk adobe-source-code-pro-fonts \
pacman -Ss xorg \
xterm \
xorg-init \
sddm \
plasma \
kde-applications \
networkmanager
systemctl enable sddm.service
sddm --example-config > /etc/sddm.conf
pacman -S net-tools dnsutils inetutils iproute2
pacman -Ss dialog wpa_supplicant netctl wireless_tools
systemctl enable fstrim.timer # 有 SSD 才需要
systemctl enable NetworkManager
# boot loader
bootctl install
cat > /boot/loader/loader.conf << EOF
default arch
timeout 3
editor 0
EOF
cat > /boot/loader/entries/arch.conf << EOF
title Arch Linux
linux /vmlinuz-linux-surface
initrd /intel-ucode.img
initrd /initramfs-linux-surface.img
options root=PARTUUID=<PARTUUID> rw
EOF
# assume root partition is /dev/nvme0n1p1
export PARTUUID=$(blkid -s PARTUUID -o value /dev/nvme0n1p1)
sed -ie "s/<PARTUUID>/${PARTUUID}/" /boot/loader/entries/arch.conf
# sudo
useradd -m Peppa
sed -ie 's/# \(%sudo ALL=(ALL) ALL\)/\1/' /etc/sudoers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment