summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/debianprogs.csv10
-rwxr-xr-xpublic/thesiah-debian.sh104
-rw-r--r--static/debianprogs.csv10
-rwxr-xr-xstatic/thesiah-debian.sh104
4 files changed, 218 insertions, 10 deletions
diff --git a/public/debianprogs.csv b/public/debianprogs.csv
index 988d249..cabb4d4 100644
--- a/public/debianprogs.csv
+++ b/public/debianprogs.csv
@@ -40,6 +40,8 @@
,fzf,is a fuzzy finder tool used for easy selection and location of files.
,gimp,is an image manipulation and paint program.
,gnome-keyring,serves as the system keyring.
+,golang-go,is a Go programming language compiler, linker, compiled stdlib.
+,go-md2man,is an utility to create manpages from markdown.
,pipewire-jack,is a low-latency audio/video router and processor for multilib support.
,lynx,"is a terminal browser also used in LARBS for generating in-terminal previews of websites, emails and HTML files."
,lxpolkit,is a policykit agent for LXDE.
@@ -51,12 +53,12 @@
,mpv,is the patrician's choice video player.
,notify-osd,allows desktop notifications.
,ncmpcpp,a ncurses interface for music with multiple formats and a powerful tag editor.
-,neovim,a tidier vim with some useful features
,newsboat,is a terminal RSS client.
,nodejs,nodejs for Neovim.
,npm,npm for tmuxinator that manages tmux sessions.
,nsxiv,is a minimalist image viewer.
,ntfs-3g,allows accessing NTFS partitions.
+,openssh-server,secure shell (SSH) server, for secure access from remote machines.
,pass,manages passwords.
,pipewire-jack,is a low-latency audio/video router and processor - JACK replacement
,pipewire-pulse,gives pipewire compatibility with PulseAudio programs.
@@ -66,6 +68,7 @@
,python3-pynvim,is for lsp in neovim.
,python3-qdarkstyle,provides a dark Qt theme.
,ripgrep,recursively searches the current directory for a regex pattern.
+,rust-eza,colorful ls.
,socat,is a utility which establishes two byte streams and transfers data between them.
,tar,compresses or extracts files.
,task-spooler,queues commands or files for download.
@@ -85,8 +88,13 @@
,xorg,"X.Org X Window System".
,xorg-server-source,is the graphical server. This first one may take a while as it pulls many other dependencies first on clean installs.
,xbacklight,enables changing screen brightness levels.
+,xdg-desktop-portal,is desktop integration portal.
,xinit,starts the graphical server.
,xwallpaper,sets the wallpaper.
+,x11-session-utils,is X session utilities.
+,x11-utils,is X11 utils.
+,x11-xkb-utils,is X11 XKB utilities.
+,x11-xserver-utils,X server utilities.
,yt-dlp,can download any YouTube video (or playlist or channel) when given the link.
,zathura,is a pdf viewer with vim-like bindings.
G,https://github.com/dandavison/delta.git,"highlights pager for git, diff, and grep output."
diff --git a/public/thesiah-debian.sh b/public/thesiah-debian.sh
index 24be8fe..53f5f71 100755
--- a/public/thesiah-debian.sh
+++ b/public/thesiah-debian.sh
@@ -68,9 +68,9 @@ installationloop() {
total=$(wc -l </tmp/progs.csv)
while IFS=, read -r tag program comment; do
case "$tag" in
- "G") gitcloneinstall "$program" "$comment" ;;
- "P") pipinstall "$program" ;;
- *) installpkg "$program" ;;
+ "G") gitmakeinstall "$program" "$comment" ;;
+ "P") pipinstall "$program" ;;
+ *) installpkg "$program" ;;
esac
done </tmp/progs.csv
}
@@ -86,6 +86,36 @@ putgitrepo() {
sudo -u "$name" cp -rfT "$dir" "$2"
}
+gitmakeinstall() {
+ progname="${1##*/}"
+ progname="${progname%.git}"
+ dir="$repodir/$progname"
+ whiptail --title "SI Installation" \
+ --infobox "Installing \`$progname\` ($n of $total) via \`git\` and \`make\`. $(basename "$1") $2" 8 70
+ sudo -u "$name" git -C "$repodir" clone --depth 1 --single-branch \
+ --no-tags -q "$1" "$dir" ||
+ {
+ cd "$dir" || return 1
+ sudo -u "$name" git pull --force origin master
+ }
+ # Check the repository name and act accordingly for suckless
+ case "$progname" in
+ "suckless")
+ for sub in "${dir}/"*; do
+ cd "$sub" || continue
+ make >/dev/null 2>&1
+ make install >/dev/null 2>&1
+ done
+ ;;
+ *)
+ cd "$dir" || exit 1
+ make >/dev/null 2>&1
+ make install >/dev/null 2>&1
+ ;;
+ esac
+ cd /tmp || return 1
+}
+
pipinstall() {
whiptail --title "SI Installation" \
--infobox "Installing the Python package \`$1\` ($n of $total). $1 $2" 9 70
@@ -102,6 +132,23 @@ vimplugininstall() {
sudo -u "$name" vim -c "PlugInstall|q|q"
}
+lfinstall() {
+ env CGO_ENABLED=0 go install -ldflags="-s -w" github.com/gokcehan/lf@latest
+}
+
+zoxideinstall() {
+ git clone https://github.com/ajeetdsouza/zoxide.git
+ cd zoxide
+ ./install.sh
+ cd /tmp
+}
+
+nviminstall() {
+ latest_version=$(curl -s https://api.github.com/repos/neovim/neovim/releases/latest | grep -o '"tag_name": ".*"' | cut -d'"' -f4)
+ download_url="https://github.com/neovim/neovim/releases/download/$latest_version/nvim.appimage"
+ curl -LO "$download_url"
+}
+
addsudo() {
echo "$name ALL=(ALL:ALL) ALL" >/etc/sudoers.d/00-thesiah-user-can-sudo
echo "$name ALL=(ALL:ALL) NOPASSWD: /usr/bin/shutdown,/usr/bin/reboot,/usr/bin/systemctl suspend,/usr/bin/wifi-menu,/usr/bin/mount,/usr/bin/umount,/usr/bin/apt update,/usr/bin/apt upgrade,/usr/bin/apt upgrade -y,/usr/bin/loadkeys,/usr/bin/apt-get --download-only upgrade" >/etc/sudoers.d/01-thesiah-cmds-without-password
@@ -110,6 +157,44 @@ addsudo() {
echo "kernel.dmesg_restrict = 0" >/etc/sysctl.d/dmesg.conf
}
+checksystem() {
+ if [ "$1" = "ufw" ]; then
+ ufw --force reload >/dev/null 2>&1
+ ufw default deny incoming >/dev/null 2>&1
+ ufw allow 80 >/dev/null 2>&1
+ ufw allow 443 >/dev/null 2>&1
+ ufw allow 25/tcp >/dev/null 2>&1
+ ufw allow 587/tcp >/dev/null 2>&1
+ ufw allow 3478/udp >/dev/null 2>&1
+ ufw allow 5349/tcp >/dev/null 2>&1
+ ufw allow 10000/udp >/dev/null 2>&1
+ ufw allow in ssh >/dev/null 2>&1
+ ufw allow in IMAPS >/dev/null 2>&1
+ ufw allow in POP3 >/dev/null 2>&1
+ ufw allow in SMTP >/dev/null 2>&1
+ ufw allow in 'WWW Full' >/dev/null 2>&1
+ ufw allow in 'Postfix SMTPS' >/dev/null 2>&1
+ ufw allow in 'Mail Submission' >/dev/null 2>&1
+ ufw enable >/dev/null 2>&1 || ufw --force enable >/dev/null 2>&1
+ fi
+ if [ "$1" = "smbd" ]; then
+ ufw --force reload >/dev/null 2>&1
+ ufw allow 137/tcp >/dev/null 2>&1
+ ufw allow 137/udp >/dev/null 2>&1
+ ufw allow 138/tcp >/dev/null 2>&1
+ ufw allow 138/udp >/dev/null 2>&1
+ ufw allow 139/tcp >/dev/null 2>&1
+ ufw allow 445/tcp >/dev/null 2>&1
+ [ -f /etc/samba/smb.conf ] && touch /etc/samba/smb.conf
+ sleep 1
+ printf "$pass1" | smbpasswd -a "$name" >/dev/null 2>&1
+ fi
+ if ! systemctl is-active --quiet "$1"; then
+ systemctl enable "$1"
+ systemctl start "$1"
+ fi
+}
+
finalize() {
whiptail --title "All done!" \
--msgbox "Congrats! Provided there were no hidden errors, the script completed successfully and all the programs and configuration files should be in place.\\n\\nTo run the new graphical environment, log out and log back in as your new user, then run the command \"startx\" to start the graphical environment (it will start automatically in tty1).\\n\\n.t Soomin" 13 80
@@ -122,7 +207,7 @@ if [ "$(id -u)" -ne 0 ]; then
exit 1
fi
-essential_packages="curl ca-certificates build-essential git ntp zsh stow"
+essential_packages="curl ca-certificates build-essential git network-manager ntp zsh stow"
whiptail --title "SI Installation" --infobox "Installing essential packages required to install and configure other programs." 8 70
for package in $essential_packages; do
installpkg $package || error "Failed to install $package"
@@ -140,6 +225,12 @@ adduserandpass || error "Error adding username and/or password."
installationloop
+lfinstall || error "User exited."
+
+zoxideinstall || error "User exited."
+
+nviminstall || error "User exited."
+
putgitrepo "$dotfilesrepo" "/home/$name" "$repobranch"
rm -rf "/home/$name/.git/" "/home/$name/README.md" "/home/$name/LICENSE" "/home/$name/FUNDING.yml"
cd "/home/$name/.dotfiles" && stow --no-folding -S debian && stow --no-folding -S default || exit 1
@@ -178,4 +269,9 @@ EndSection' >/etc/X11/xorg.conf.d/40-libinput.conf
# (like `shutdown` to run without password).
addsudo
+systems="NetworkManager ssh bluetooth ufw"
+for system in $systems; do
+ checksystem $system || error "Failed to start $system"
+done
+
finalize
diff --git a/static/debianprogs.csv b/static/debianprogs.csv
index 988d249..cabb4d4 100644
--- a/static/debianprogs.csv
+++ b/static/debianprogs.csv
@@ -40,6 +40,8 @@
,fzf,is a fuzzy finder tool used for easy selection and location of files.
,gimp,is an image manipulation and paint program.
,gnome-keyring,serves as the system keyring.
+,golang-go,is a Go programming language compiler, linker, compiled stdlib.
+,go-md2man,is an utility to create manpages from markdown.
,pipewire-jack,is a low-latency audio/video router and processor for multilib support.
,lynx,"is a terminal browser also used in LARBS for generating in-terminal previews of websites, emails and HTML files."
,lxpolkit,is a policykit agent for LXDE.
@@ -51,12 +53,12 @@
,mpv,is the patrician's choice video player.
,notify-osd,allows desktop notifications.
,ncmpcpp,a ncurses interface for music with multiple formats and a powerful tag editor.
-,neovim,a tidier vim with some useful features
,newsboat,is a terminal RSS client.
,nodejs,nodejs for Neovim.
,npm,npm for tmuxinator that manages tmux sessions.
,nsxiv,is a minimalist image viewer.
,ntfs-3g,allows accessing NTFS partitions.
+,openssh-server,secure shell (SSH) server, for secure access from remote machines.
,pass,manages passwords.
,pipewire-jack,is a low-latency audio/video router and processor - JACK replacement
,pipewire-pulse,gives pipewire compatibility with PulseAudio programs.
@@ -66,6 +68,7 @@
,python3-pynvim,is for lsp in neovim.
,python3-qdarkstyle,provides a dark Qt theme.
,ripgrep,recursively searches the current directory for a regex pattern.
+,rust-eza,colorful ls.
,socat,is a utility which establishes two byte streams and transfers data between them.
,tar,compresses or extracts files.
,task-spooler,queues commands or files for download.
@@ -85,8 +88,13 @@
,xorg,"X.Org X Window System".
,xorg-server-source,is the graphical server. This first one may take a while as it pulls many other dependencies first on clean installs.
,xbacklight,enables changing screen brightness levels.
+,xdg-desktop-portal,is desktop integration portal.
,xinit,starts the graphical server.
,xwallpaper,sets the wallpaper.
+,x11-session-utils,is X session utilities.
+,x11-utils,is X11 utils.
+,x11-xkb-utils,is X11 XKB utilities.
+,x11-xserver-utils,X server utilities.
,yt-dlp,can download any YouTube video (or playlist or channel) when given the link.
,zathura,is a pdf viewer with vim-like bindings.
G,https://github.com/dandavison/delta.git,"highlights pager for git, diff, and grep output."
diff --git a/static/thesiah-debian.sh b/static/thesiah-debian.sh
index 24be8fe..53f5f71 100755
--- a/static/thesiah-debian.sh
+++ b/static/thesiah-debian.sh
@@ -68,9 +68,9 @@ installationloop() {
total=$(wc -l </tmp/progs.csv)
while IFS=, read -r tag program comment; do
case "$tag" in
- "G") gitcloneinstall "$program" "$comment" ;;
- "P") pipinstall "$program" ;;
- *) installpkg "$program" ;;
+ "G") gitmakeinstall "$program" "$comment" ;;
+ "P") pipinstall "$program" ;;
+ *) installpkg "$program" ;;
esac
done </tmp/progs.csv
}
@@ -86,6 +86,36 @@ putgitrepo() {
sudo -u "$name" cp -rfT "$dir" "$2"
}
+gitmakeinstall() {
+ progname="${1##*/}"
+ progname="${progname%.git}"
+ dir="$repodir/$progname"
+ whiptail --title "SI Installation" \
+ --infobox "Installing \`$progname\` ($n of $total) via \`git\` and \`make\`. $(basename "$1") $2" 8 70
+ sudo -u "$name" git -C "$repodir" clone --depth 1 --single-branch \
+ --no-tags -q "$1" "$dir" ||
+ {
+ cd "$dir" || return 1
+ sudo -u "$name" git pull --force origin master
+ }
+ # Check the repository name and act accordingly for suckless
+ case "$progname" in
+ "suckless")
+ for sub in "${dir}/"*; do
+ cd "$sub" || continue
+ make >/dev/null 2>&1
+ make install >/dev/null 2>&1
+ done
+ ;;
+ *)
+ cd "$dir" || exit 1
+ make >/dev/null 2>&1
+ make install >/dev/null 2>&1
+ ;;
+ esac
+ cd /tmp || return 1
+}
+
pipinstall() {
whiptail --title "SI Installation" \
--infobox "Installing the Python package \`$1\` ($n of $total). $1 $2" 9 70
@@ -102,6 +132,23 @@ vimplugininstall() {
sudo -u "$name" vim -c "PlugInstall|q|q"
}
+lfinstall() {
+ env CGO_ENABLED=0 go install -ldflags="-s -w" github.com/gokcehan/lf@latest
+}
+
+zoxideinstall() {
+ git clone https://github.com/ajeetdsouza/zoxide.git
+ cd zoxide
+ ./install.sh
+ cd /tmp
+}
+
+nviminstall() {
+ latest_version=$(curl -s https://api.github.com/repos/neovim/neovim/releases/latest | grep -o '"tag_name": ".*"' | cut -d'"' -f4)
+ download_url="https://github.com/neovim/neovim/releases/download/$latest_version/nvim.appimage"
+ curl -LO "$download_url"
+}
+
addsudo() {
echo "$name ALL=(ALL:ALL) ALL" >/etc/sudoers.d/00-thesiah-user-can-sudo
echo "$name ALL=(ALL:ALL) NOPASSWD: /usr/bin/shutdown,/usr/bin/reboot,/usr/bin/systemctl suspend,/usr/bin/wifi-menu,/usr/bin/mount,/usr/bin/umount,/usr/bin/apt update,/usr/bin/apt upgrade,/usr/bin/apt upgrade -y,/usr/bin/loadkeys,/usr/bin/apt-get --download-only upgrade" >/etc/sudoers.d/01-thesiah-cmds-without-password
@@ -110,6 +157,44 @@ addsudo() {
echo "kernel.dmesg_restrict = 0" >/etc/sysctl.d/dmesg.conf
}
+checksystem() {
+ if [ "$1" = "ufw" ]; then
+ ufw --force reload >/dev/null 2>&1
+ ufw default deny incoming >/dev/null 2>&1
+ ufw allow 80 >/dev/null 2>&1
+ ufw allow 443 >/dev/null 2>&1
+ ufw allow 25/tcp >/dev/null 2>&1
+ ufw allow 587/tcp >/dev/null 2>&1
+ ufw allow 3478/udp >/dev/null 2>&1
+ ufw allow 5349/tcp >/dev/null 2>&1
+ ufw allow 10000/udp >/dev/null 2>&1
+ ufw allow in ssh >/dev/null 2>&1
+ ufw allow in IMAPS >/dev/null 2>&1
+ ufw allow in POP3 >/dev/null 2>&1
+ ufw allow in SMTP >/dev/null 2>&1
+ ufw allow in 'WWW Full' >/dev/null 2>&1
+ ufw allow in 'Postfix SMTPS' >/dev/null 2>&1
+ ufw allow in 'Mail Submission' >/dev/null 2>&1
+ ufw enable >/dev/null 2>&1 || ufw --force enable >/dev/null 2>&1
+ fi
+ if [ "$1" = "smbd" ]; then
+ ufw --force reload >/dev/null 2>&1
+ ufw allow 137/tcp >/dev/null 2>&1
+ ufw allow 137/udp >/dev/null 2>&1
+ ufw allow 138/tcp >/dev/null 2>&1
+ ufw allow 138/udp >/dev/null 2>&1
+ ufw allow 139/tcp >/dev/null 2>&1
+ ufw allow 445/tcp >/dev/null 2>&1
+ [ -f /etc/samba/smb.conf ] && touch /etc/samba/smb.conf
+ sleep 1
+ printf "$pass1" | smbpasswd -a "$name" >/dev/null 2>&1
+ fi
+ if ! systemctl is-active --quiet "$1"; then
+ systemctl enable "$1"
+ systemctl start "$1"
+ fi
+}
+
finalize() {
whiptail --title "All done!" \
--msgbox "Congrats! Provided there were no hidden errors, the script completed successfully and all the programs and configuration files should be in place.\\n\\nTo run the new graphical environment, log out and log back in as your new user, then run the command \"startx\" to start the graphical environment (it will start automatically in tty1).\\n\\n.t Soomin" 13 80
@@ -122,7 +207,7 @@ if [ "$(id -u)" -ne 0 ]; then
exit 1
fi
-essential_packages="curl ca-certificates build-essential git ntp zsh stow"
+essential_packages="curl ca-certificates build-essential git network-manager ntp zsh stow"
whiptail --title "SI Installation" --infobox "Installing essential packages required to install and configure other programs." 8 70
for package in $essential_packages; do
installpkg $package || error "Failed to install $package"
@@ -140,6 +225,12 @@ adduserandpass || error "Error adding username and/or password."
installationloop
+lfinstall || error "User exited."
+
+zoxideinstall || error "User exited."
+
+nviminstall || error "User exited."
+
putgitrepo "$dotfilesrepo" "/home/$name" "$repobranch"
rm -rf "/home/$name/.git/" "/home/$name/README.md" "/home/$name/LICENSE" "/home/$name/FUNDING.yml"
cd "/home/$name/.dotfiles" && stow --no-folding -S debian && stow --no-folding -S default || exit 1
@@ -178,4 +269,9 @@ EndSection' >/etc/X11/xorg.conf.d/40-libinput.conf
# (like `shutdown` to run without password).
addsudo
+systems="NetworkManager ssh bluetooth ufw"
+for system in $systems; do
+ checksystem $system || error "Failed to start $system"
+done
+
finalize