|
@@ -138,6 +138,12 @@ sed -i "/ssh-add/d" "$(getent passwd root | cut -d: -f6)/.bashrc"
|
|
# install protontricks
|
|
# install protontricks
|
|
python3 -m pip install protontricks
|
|
python3 -m pip install protontricks
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
# enable ccache and optimize cores for AUR
|
|
# enable ccache and optimize cores for AUR
|
|
sed -i 's/!ccache/ccache/' /etc/makepkg.conf
|
|
sed -i 's/!ccache/ccache/' /etc/makepkg.conf
|
|
sed -i 's/^#MAKEFLAGS.*/MAKEFLAGS="-j$(($(nproc) + 1)) -l$(nproc)"/' /etc/makepkg.conf
|
|
sed -i 's/^#MAKEFLAGS.*/MAKEFLAGS="-j$(($(nproc) + 1)) -l$(nproc)"/' /etc/makepkg.conf
|
|
@@ -159,6 +165,11 @@ sudo -u $aur_username git clone https://aur.archlinux.org/numix-icon-theme-git.g
|
|
|
|
|
|
# wev
|
|
# wev
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
# cleanup aur user
|
|
# cleanup aur user
|
|
rm -rf /etc/sudoers.d/${aur_username}
|
|
rm -rf /etc/sudoers.d/${aur_username}
|
|
userdel -fr $aur_username
|
|
userdel -fr $aur_username
|
|
@@ -205,42 +216,37 @@ su - postgres -c "initdb --locale en_US.UTF-8 -D '/var/lib/postgres/data'"
|
|
echo "net.core.rmem_max = 4194304" > /etc/sysctl.d/transmission.conf
|
|
echo "net.core.rmem_max = 4194304" > /etc/sysctl.d/transmission.conf
|
|
echo "net.core.wmem_max = 1048576" >> /etc/sysctl.d/transmission.conf
|
|
echo "net.core.wmem_max = 1048576" >> /etc/sysctl.d/transmission.conf
|
|
|
|
|
|
-# check whether username and password are not empty
|
|
|
|
-if [[ -n "$username" && -n "$password" ]]; then
|
|
|
|
-
|
|
|
|
- # create user if not exists, else (re)-install dot-files
|
|
|
|
- if ! id $username &> /dev/null; then
|
|
|
|
- useradd -m -s /bin/bash $username
|
|
|
|
- echo "${username}:${password}" | chpasswd -c SHA256
|
|
|
|
- else
|
|
|
|
- [ $EUID -ne 0 ] && rsync -Pav /etc/skel/ "$(getent passwd $username | cut -d: -f6)/"
|
|
|
|
- fi
|
|
|
|
-
|
|
|
|
- # add user to standard groups
|
|
|
|
- usermod -aG users,sudo,adm,input,audio,video,disk,storage,lp,vboxusers $username
|
|
|
|
-
|
|
|
|
- # generate postgres user and user database
|
|
|
|
- systemctl start postgresql
|
|
|
|
- su postgres -c "cd && createuser -ds $username" 2> /dev/null && su $username -c "cd && createdb"
|
|
|
|
-
|
|
|
|
- # load xdg-user-dirs
|
|
|
|
- su $username -c "cd && xdg-user-dirs-update"
|
|
|
|
- update-desktop-database
|
|
|
|
-
|
|
|
|
- # generate default (passwordless) ed25519 ssh key if none exists
|
|
|
|
- su $username -c "cd; if [ ! -f ~/.ssh/id_ed25519 ]; then ssh-keygen -q -t ed25519 -N '' -f ~/.ssh/id_ed25519 && cd && chmod 600 ~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519.pub; fi"
|
|
|
|
-
|
|
|
|
- # install gvm loading from ~/.bashrc & ~/.bash_profile, and the latest go version
|
|
|
|
- su $username -c "if [ ! -d ~/.gvm ]; then GVM_NO_UPDATE_PROFILE=1 bash < <(curl -Ls https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer 2> /dev/null); fi"
|
|
|
|
- su $username -c 'grep "gvm" ~/.bash_profile &> /dev/null || echo -e "\n# load gvm\n[ -s $HOME/.gvm/scripts/gvm ] && . $HOME/.gvm/scripts/gvm" >> ~/.bash_profile'
|
|
|
|
- su $username -c 'grep "gvm" ~/.bashrc &> /dev/null || echo -e "\n# load gvm\n[ -s $HOME/.gvm/scripts/gvm ] && . $HOME/.gvm/scripts/gvm" >> ~/.bashrc'
|
|
|
|
- su $username -c ". ~/.gvm/scripts/gvm && gvm install go1.17.6 -B && gvm use go1.17.6 --default"
|
|
|
|
-
|
|
|
|
- # configure user-space transmission
|
|
|
|
- if [ ! -f "/etc/systemd/system/transmission.service.d/local.conf" ]; then
|
|
|
|
- su $username -c "cd && mkdir -p ~/transmission/{done,incomplete}"
|
|
|
|
- su $username -c 'cd && tmp=$(mktemp) && jq ".[\"download-dir\"] = \"${HOME}/transmission/done\"" $HOME/.config/transmission-daemon/settings.json | jq ".[\"incomplete-dir\"] = \"${HOME}/transmission/incomplete\"" | jq ".[\"watch-dir\"] = \"$(xdg-user-dir DOWNLOAD)\"" > $tmp && mv $tmp $HOME/.config/transmission-daemon/settings.json'
|
|
|
|
- fi
|
|
|
|
|
|
+# create user if not exists, else (re)-install dot-files
|
|
|
|
+if ! id $username &> /dev/null; then
|
|
|
|
+ useradd -m -s /bin/bash $username
|
|
|
|
+ echo "${username}:${password}" | chpasswd -c SHA256
|
|
|
|
+else
|
|
|
|
+ [ $EUID -ne 0 ] && rsync -Pav /etc/skel/ "$(getent passwd $username | cut -d: -f6)/"
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+# add user to standard groups
|
|
|
|
+usermod -aG users,sudo,adm,input,audio,video,disk,storage,lp,vboxusers $username
|
|
|
|
+
|
|
|
|
+# generate postgres user and user database
|
|
|
|
+systemctl start postgresql
|
|
|
|
+su postgres -c "cd && createuser -ds $username" 2> /dev/null && su $username -c "cd && createdb"
|
|
|
|
+
|
|
|
|
+# load xdg-user-dirs
|
|
|
|
+su $username -c "cd && xdg-user-dirs-update"
|
|
|
|
+update-desktop-database
|
|
|
|
+
|
|
|
|
+# generate default (passwordless) ed25519 ssh key if none exists
|
|
|
|
+su $username -c "cd; if [ ! -f ~/.ssh/id_ed25519 ]; then ssh-keygen -q -t ed25519 -N '' -f ~/.ssh/id_ed25519 && cd && chmod 600 ~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519.pub; fi"
|
|
|
|
+
|
|
|
|
+# install gvm loading from ~/.bashrc & ~/.bash_profile, and the latest go version
|
|
|
|
+su $username -c "if [ ! -d ~/.gvm ]; then GVM_NO_UPDATE_PROFILE=1 bash < <(curl -Ls https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer 2> /dev/null); fi"
|
|
|
|
+su $username -c 'grep "gvm" ~/.bash_profile &> /dev/null || echo -e "\n# load gvm\n[ -s $HOME/.gvm/scripts/gvm ] && . $HOME/.gvm/scripts/gvm" >> ~/.bash_profile'
|
|
|
|
+su $username -c ". ~/.gvm/scripts/gvm && gvm install go1.17.6 -B && gvm use go1.17.6 --default"
|
|
|
|
+
|
|
|
|
+# configure user-space transmission
|
|
|
|
+if [ ! -f "/etc/systemd/system/transmission.service.d/local.conf" ]; then
|
|
|
|
+ su $username -c "cd && mkdir -p ~/transmission/{done,incomplete}"
|
|
|
|
+ su $username -c 'cd && tmp=$(mktemp) && jq ".[\"download-dir\"] = \"${HOME}/transmission/done\"" $HOME/.config/transmission-daemon/settings.json | jq ".[\"incomplete-dir\"] = \"${HOME}/transmission/incomplete\"" | jq ".[\"watch-dir\"] = \"$(xdg-user-dir DOWNLOAD)\"" > $tmp && mv $tmp $HOME/.config/transmission-daemon/settings.json'
|
|
fi
|
|
fi
|
|
|
|
|
|
# symlink shceduled maintenance tasks
|
|
# symlink shceduled maintenance tasks
|