-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·102 lines (89 loc) · 2.58 KB
/
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
98
99
100
101
102
#!/bin/sh
# Set up custom installation. Run this script after base installation is done.
# Configure packages/*.txt for packages to install.
host="$(hostnamectl hostname)" # get hostname
# Global config
# Copy /etc files
rm /etc/security/pam_env.conf
sudo cp -r etc /
case "$host" in
*laptop*)
sudo cp -r laptop/etc /
;;
esac
# Install packages
# pacman
sudo pacman -Syu
cd packages || exit
# shellcheck disable=SC2024
[ -f pacman.txt ] && sudo pacman -S --needed - < pacman.txt
case "$host" in
*desktop*)
# shellcheck disable=SC2024
[ -f pacman_desktop.txt ] \
&& sudo pacman -S --needed - < pacman_desktop.txt
;;
*laptop*)
# shellcheck disable=SC2024
[ -f pacman_laptop.txt ] \
&& sudo pacman -S --needed - < pacman_laptop.txt
;;
esac
cd ..
# AUR install with paru
cd packages || exit
if ! [ -x /usr/bin/paru ]; then
git clone https://aur.archlinux.org/paru.git
cd paru || exit
makepkg -si
cd .. || exit
rm -rf paru
fi
[ -f aur.txt ] && paru -S --needed - < aur.txt
case "$host" in
*desktop*)
[ -f aur_desktop.txt ] && paru -S --needed - < aur_desktop.txt
;;
*laptop*)
[ -f aur_laptop.txt ] && paru -S --needed - < aur_laptop.txt
;;
esac
cd ..
# systemd
sudo timedatectl set-ntp true
sudo systemctl enable cups.socket
# User config
# flexget inside virtual environment
mkdir -p ~/data/.environments
python -m venv ~/data/.environments/flexget
~/data/.environments/flexget/bin/pip install --upgrade pip
~/data/.environments/flexget/bin/pip install flexget transmission-rpc
# User and group management
sudo usermod -s /bin/zsh "$USER"
sudo usermod -aG libvirt "$USER"
# Create directories
mkdir -p ~/.config
mkdir -p ~/.local/share/applications
mkdir -p ~/.local/share/gnupg
mkdir -p ~/.local/share/isync/mailbox
mkdir -p ~/.local/share/isync/tuw
mkdir -p ~/.local/share/torrents
mkdir -p ~/.local/state/temp
mkdir -p ~/.ssh
# Set directory permission
chmod 700 ~/.local/share/gnupg
chmod 700 ~/.ssh
# Why does "~" instead of "$HOME" cause errors in stow command?
stow home --dir="$HOME/.dotfiles" --target="$HOME" home
# Remove bash files
rm ~/.bash*
systemctl enable --user [email protected]
systemctl enable --user [email protected]
systemctl enable --user huewarm.timer
systemctl enable --user mailsync.timer
systemctl enable --user newsboat.timer
systemctl enable --user ssh-agent.service
systemctl enable --user syncthing.service
systemctl enable --user trash-empty.timer
# Finalize
printf '\033[1mCustom installation is done. Please reboot.\n'