-
Notifications
You must be signed in to change notification settings - Fork 0
/
firstboot.txt
73 lines (70 loc) · 3.6 KB
/
firstboot.txt
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
#!/bin/bash
# $KYAULabs: firstboot.txt,v 1.1.1 2022/08/05 16:09:51 kyau Exp $
# ▄▄▄▄ ▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
# █ ▄▄ ▄ ▄▄ ▄ ▄▄▄▄ ▄▄ ▄ ▄▄ ▄▄▄▄ ▄▄▄▄ ▄▄▄ ▀
# █ ██ █ ██ █ ██ █ ██ █ ██ ██ █ ██ █ ██▀ █
# ■ ██▄▀ ██▄█ ██▄█ ██ █ ▀▀ ██ ██▄█ ██▄▀ ▀██▄ ■
# █ ██ █ ▄▄ █ ██ █ ██ █ ██▄▄ ██ █ ██ █ ▄██ █
# ▄ ▀▀ ▀ ▀▀▀▀ ▀▀ ▀ ▀▀▀▀ ▀▀▀▀ ▀▀ ▀ ▀▀▀▀ ▀▀▀ █
# ▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀
#
# Automated Arch Linux (KYAU Labs Edition)
# Copyright (C) 2022 KYAU Labs (https://kyaulabs.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
echo "-- AARCH: STARSHIP --"
# download and install starship cross-shell prompt
/bin/sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --yes
echo "-- AARCH: FISH SHELL --"
# change users default shell to fish
chsh -s /usr/bin/fish "${AA_USERNAME}"
# fetch dotfiles from github and run script to setup symlinks
runuser -l "${AA_USERNAME}" -c 'git clone https://github.com/kyau/dotfiles.git'
_ADD=
if [ "${AA_XORG}" -ne "0" ]; then
_ADD="x"
fi
# download and install dotfiles from github
runuser -l "${AA_USERNAME}" -c "/bin/bash /home/${AA_USERNAME}/dotfiles/dotme -${_ADD}p ${AA_MACHINEROLE}"
runuser -l "${AA_USERNAME}" -c 'rm -rf ~/dotfiles'
# download fisher package manager for fish
runuser -l "${AA_USERNAME}" -c 'curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher'
# download tpm package manager for tmux
runuser -l "${AA_USERNAME}" -c 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm'
# download Vundle package manager for vim
runuser -l "${AA_USERNAME}" -c 'git clone https://github.com/VundleVim/Vundle.vim ~/.vim/bundle/Vundle.vim'
# run fisher to download fish packages
runuser -l "${AA_USERNAME}" -c 'fisher'
# run vundle to download vim packages
runuser -l "${AA_USERNAME}" -c 'vim +PluginInstall +qall'
# read from arch package file and install all needed packages
#
# this will execute '${AA_PKGMAN} -S <name>' on every package listed in the file
# pertaining to the role you selected in your template. (eg. ~/dot/.pkg-vm)
echo "-- AARCH: PACKAGES --"
mapfile -t lines <"/home/${AA_USERNAME}/dot/.pkg-${AA_MACHINEROLE}"
if [ ${#lines[@]} -eq 0 ]; then
printf "No packages detected~\\n"
else
for pkg in "${lines[@]}"; do
# if imported line is a comment or blank, skip
if [ "${pkg:0:1}" = "#" ] || [ -z "${pkg}" ]; then continue; fi
if ${AA_PKGMAN} -S "${pkg}" --noedit --nodiff --noconfirm > /dev/null 2>&1; then
printf "%s: installed via ${AA_PKGMAN}.\\n" "${pkg}"
else
printf "! %s: failed to install.\\n" "${pkg}"
fi
done
fi
# vim: ft=bash sts=4 sw=4 ts=4 noet: