-
Notifications
You must be signed in to change notification settings - Fork 0
/
fresharch
executable file
·337 lines (299 loc) · 7.8 KB
/
fresharch
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
#!/bin/bash
###### ####### ## ## ######## #### ######
## ## ## ## ### ## ## ## ## ##
## ## ## #### ## ## ## ##
## ## ## ## ## ## ###### ## ## ####
## ## ## ## #### ## ## ## ##
## ## ## ## ## ### ## ## ## ##
###### ####### ## ## ## #### ######
user_name=frosty
development=true
dwm=false
pulse=true
slim=true
subtle=false
syslinux=true
utils=true
virtualize=true
virt_box_guest=false
xfce=true
xorg=true
UEFI=false
frostyrepo=false
dhcpcd=true
## ## ######## ## ######## ######## ######## ######
## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ##
######### ###### ## ######## ###### ######## ######
## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ##
## ## ######## ######## ## ######## ## ## ######
function istrue() {
[ "$1" = true ]
return $?
}
#### ## ## ###### ######## ### ## ##
## ### ## ## ## ## ## ## ## ##
## #### ## ## ## ## ## ## ##
## ## ## ## ###### ## ## ## ## ##
## ## #### ## ## ######### ## ##
## ## ### ## ## ## ## ## ## ##
#### ## ## ###### ## ## ## ######## ########
#
# Broken Packages:
# kvirc
# livestreamer
# scim-anthy
# sqlitemanager
# xorg-server-utils
# abs
# nvidia*
# firefox-developer
#
pacstrap /mnt base || exit 1
packages=()
#packages+=('')
if istrue $development; then
packages+=(base-devel)
fi
if istrue $dwm; then
packages+=('dwm')
packages+=('dunst')
packages+=('busking')
packages+=('xautolock')
packages+=('slock')
fi
if istrue $slim; then
packages+=('slim')
fi
if istrue $subtle; then
packages+=('subtle')
fi
if istrue $syslinux; then
packages+=('syslinux')
fi
if istrue $pulse; then
packages+=('alsa-utils')
#packages+=('alsamixer')
packages+=('paprefs')
packages+=('pavucontrol')
packages+=('ponymix')
packages+=('pulseaudio')
fi
# TODO sort this list
if istrue $utils; then
packages+=(nvidia{,-libgl})
packages+=({,python2-}autopep8)
packages+=(python{,2}-pip)
packages+=('abs')
packages+=('base-devel')
packages+=('bridge-utils')
packages+=('git')
packages+=('htop')
packages+=('logrotate')
packages+=('lsof')
packages+=('mpd')
packages+=('ncdu')
packages+=('ncmpcpp')
packages+=('nfs-utils')
packages+=('openbsd-netcat')
packages+=('openssh')
packages+=('python')
packages+=('rxvt-unicode')
packages+=('samba')
packages+=('screen')
packages+=('sshfs')
packages+=('sudo')
packages+=('syslog-ng')
packages+=('tmux')
packages+=('tree')
packages+=('vim')
packages+=('zsh')
packages+=('arch-install-scripts')
packages+=('archey3')
packages+=('aria2')
packages+=('asciiquarium')
packages+=('bc')
packages+=('cowsay')
packages+=('cronie')
packages+=('dnsutils')
packages+=('docker')
packages+=('fortune-mod')
packages+=('adobe-source-code-pro-fonts')
packages+=('arandr')
packages+=('boost')
packages+=('btrfs-progs')
packages+=('busking')
packages+=('bzr')
packages+=('chromium-pepper-flash')
packages+=('clusterssh')
packages+=('dmenu')
packages+=('dunst')
packages+=('dwarffortress')
packages+=('dwm')
packages+=('elinks')
packages+=('feh')
packages+=('figlet')
packages+=('firefox-developer')
packages+=('gimp')
packages+=('imagemagick')
packages+=('ipcalc')
packages+=('keychain')
packages+=('kvirc')
packages+=('leafpad')
packages+=('livestreamer')
packages+=('meld')
packages+=('mosh')
packages+=('mpd')
packages+=('mplayer')
packages+=('namcap')
packages+=('ncmpcpp')
packages+=('nodejs')
packages+=('pkgfile')
packages+=('python')
packages+=('python2-beautifulsoup4')
packages+=('rdesktop')
packages+=('renzoku')
packages+=('ruby')
packages+=('sc')
packages+=('scim')
packages+=('scim-anthy')
packages+=('scrot')
packages+=('scudcloud')
#packages+=('sendmail')
#packages+=('skype')
packages+=('sqlite')
packages+=('sqlitemanager')
packages+=('surf')
packages+=('synergy')
#packages+=('terminus')
packages+=('todotxt')
packages+=('ttf-ms-fonts')
packages+=('wget')
packages+=('xcompmgr')
packages+=('xorg-xauth')
packages+=('xorg-xclock')
packages+=('xorg-xfontsel')
packages+=('xorg-xinit')
packages+=('xscreensaver')
packages+=('xterm')
packages+=('youtube-dl')
packages+=('zim')
packages+=('zsh')
packages+=('ctags')
packages+=('xautolock')
packages+=('slock')
packages+=('sshguard')
fi
if istrue $virtualize; then
packages+=('libvirt')
packages+=('qemu')
packages+=('virtualbox')
packages+=('virt-manager')
# packages+=('virt-viewer')
fi
if istrue $dwm; then
packages+=('virtualbox-guest-utils')
packages+=('virtualbox-guest-modules-arch')
fi
if istrue $xfce; then
packages+=('xfce4')
fi
if istrue $xorg; then
packages+=(xorg-server{,-utils})
packages+=(xf86-video-{intel,nouveau})
packages+=('chromium')
packages+=('firefox-developer')
packages+=('xscreensaver')
fi
if istrue $UEFI; then
packages+=('efibootmgr')
fi
if istrue $frostyrepo && (grep -v frostyfrog /etc/pacman.conf); then
sed "/\[core/i [frostyrepo]\nServer = http://repo.frostyfrog.net/\n\n" /etc/pacman.conf
fi
if istrue $dhcpcd; then
packages+=('dhcpcd')
fi
###### ######## ######## ## ## ########
## ## ## ## ## ## ## ##
## ## ## ## ## ## ##
###### ###### ## ## ## ########
## ## ## ## ## ##
## ## ## ## ## ## ##
###### ######## ## ####### ##
echo -e 'LANG="en_US.UTF-8"\nLC_COLLATE="C"'>> /mnt/etc/locale.conf
sed -i 's/^#\(en_US\|ja_JP\)/\1/' /mnt/etc/locale.gen
cat <<EOCHROOT | arch-chroot /mnt
function istrue() {
[ "\$1" = true ]
return \$?
}
pacman-key --init
pacman-key --populate archlinux
dirmngr < /dev/null
pacman-key -r 0x362db4a50060df7b || exit 1
pacman-key -f 0x362db4a50060df7b
sleep 1m
pacman-key --lsign 0x362db4a50060df7b
kill -15 $(lsof /dev|grep '(gpg-agent|dirmgr)'|awk '{print $2;}'|uniq)
if istrue $frostyrepo; then
sed "/\\[core/i [frostyrepo]\\nSigLevel = Required\\nServer = http://repo.frostyfrog.net/\\n\\n" -i /etc/pacman.conf
fi
pacman-db-upgrade
pacman -Syy ${packages[*]} --noconfirm || exit 1
mkinitcpio -p linux
locale-gen
ln -s /usr/share/zoneinfo/America/Denver /etc/localtime
if istrue $virtualize; then
groupadd libvirt
fi
cat <<EOF > /etc/polkit-1/rules.d/50-org.libvirt.unix.manage.rules
polkit.addRule(function(action, subject) {
if (action.id == "org.libvirt.unix.manage" &&
subject.isInGroup("libvirt")) {
return polkit.Result.Yes;
}
});
EOF
useradd -m -G wheel,users,systemd-journal -s /bin/zsh $user_name
if istrue $utils; then
gpasswd -a $user_name mpd
fi
if istrue $virtualize; then
gpasswd -a $user_name vboxusers
gpasswd -a $user_name libvirt
fi
update-ca-certificates # https://www.archlinux.org/news/ca-certificates-update/
cat <<EOSU | su - $user_name
git clone https://github.com/frostyfrog/dotfiles.git .files
cd .files
git submodule update --init --recursive
./autocopy
EOSU
mkdir -p /var/lib/mpd/music/music
ln -s /var/lib/mpd/music/music /home/$user_name/music
chown $user_name:users /home/$user_name/music
chown $user_name:users /var/lib/mpd/music/music
if istrue $dhcpcd; then
systemctl enable dhcpcd
fi
if istrue $utils; then
systemctl enable sshd mpd
fi
if istrue $slim; then
systemctl enable slim
fi
if istrue $virtualize; then
systemctl enable libvirtd
fi
if istrue $syslinux; then
syslinux-install_update -i -a -m
fi
EOCHROOT
genfstab -p /mnt >> /mnt/etc/fstab
echo <<EOF
Please change the password of "$user_name"
Please correct the config in /boot/syslinux/syslinux.conf
EOF
# vim: set ai ft=sh syntax=sh :