-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharch-install.sh
97 lines (87 loc) · 3.15 KB
/
arch-install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/usr/bin/bash
# Dotfiles
# git clone https://github.com/NghiaHaNgoc/dotfiles.git /root/dotfiles
# Date time
echo -e "\033[1;44m SETUP DATETIME \033[0m"
ln -sf /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime
hwclock --systohc
# Language
echo -e "\033[1;44m SETUP LANGUAGE \033[0m"
sed -i '/^#en_US.UTF-8 UTF-8/s/^#//' /etc/locale.gen
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8
# Network
echo -e "\033[1;44m SETUP NETWORK \033[0m"
echo "archlinux" > /etc/hostname
echo "127.0.0.1 localhost
::1 localhost
127.0.1.1 archlinux" > /etc/hosts
echo '[main]
dns=none' >> /etc/NetworkManager/NetworkManager.conf
echo '
nameserver 1.1.1.1
nameserver 8.8.8.8
nameserver 2606:4700:4700::1111
nameserver 2001:4860:4860::8888
' > /etc/resolv.conf
# Pacman
echo -e "\033[1;44m SETUP PACKAGE MANAGER \033[0m"
sed -i '/#Color/a ILoveCandy' /etc/pacman.conf
sed -i '/^#Color/s/^#//g' /etc/pacman.conf
sed -i '/^#ParallelDownloads/s/^#//g' /etc/pacman.conf
# Grub
echo -e "\033[1;44m INSTALL GRUB \033[0m"
pacman -S --noconfirm grub efibootmgr os-prober
mkdir /boot/efi
mount /dev/nvme1n1p1 /boot/efi # WARN: select right partition
sed -i '/^#GRUB_DISABLE_OS_PROBER/s/^#//g' /etc/default/grub
sed -i '/^#GRUB_THEME/s/=.*/=\"\/boot\/grub\/themes\/arch\/theme.txt\"/g' /etc/default/grub
sed -i '/^#GRUB_THEME/s/^#//g' /etc/default/grub
grub-install --target=x86_64-efi --bootloader-id=arch --efi-directory=/boot/efi --recheck
mkdir -p /boot/grub/themes
cp -r /root/dotfiles/system/boot /
grub-mkconfig -o /boot/grub/grub.cfg
# Essential package
echo -e "\033[1;44m INSTALL GNOME PACKAGE \033[0m"
pacman -S --noconfirm gnome
echo -e "\033[1;44m REMOVE UNUSED GNOME PACKAGE \033[0m"
pacman -Rsn --noconfirm \
epiphany evince gnome-backgrounds gnome-calculator gnome-calendar \
gnome-characters gnome-clocks gnome-connections gnome-console \
gnome-contacts gnome-disk-utility gnome-font-viewer \
gnome-logs gnome-maps gnome-menus gnome-music gnome-software gnome-text-editor \
gnome-tour gnome-user-docs gnome-user-share gnome-weather \
grilo-plugins gvfs-afc gvfs-dnssd gvfs-goa gvfs-google gvfs-gphoto2 \
gvfs-mtp gvfs-nfs gvfs-onedrive gvfs-smb gvfs-wsdd \
malcontent orca rygel simple-scan snapshot sushi tracker3-miners yelp totem
echo -e "\033[1;44m INSTALl NECESSARY PACKAGE \033[0m"
pacman -S --noconfirm \
chromium kitty file-roller libreoffice-fresh \
lua-language-server rust rust-analyzer go gopls code docker nodejs npm \
ripgrep python-nautilus starship fish wl-clipboard\
noto-fonts noto-fonts-cjk noto-fonts-emoji woff2-fira-code ttf-nerd-fonts-symbols
# User
echo -e "\033[1;44m USER SETUP \033[0m"
echo -e "\033[1;32m Enter root password \033[0m"
passwd
useradd -m nghiaha
echo -e "\033[1;32m Enter nghiaha password \033[0m"
passwd nghiaha
usermod -aG wheel nghiaha
chsh -s /usr/bin/fish nghiaha
EDITOR=nvim visudo
# Service
echo -e "\033[1;44m ENABLE SERVICE \033[0m"
systemctl enable docker.service
systemctl enable gdm.service
systemctl enable NetworkManager.service
systemctl start NetworkManager.service
echo '
nameserver 1.1.1.1
nameserver 8.8.8.8
nameserver 2606:4700:4700::1111
nameserver 2001:4860:4860::8888
' > /etc/resolv.conf
# Clean up
rm -r /root/dotfiles