aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Williams <tgwil@tgwil.net>2024-10-21 03:34:47 -0400
committerTristan Williams <tgwil@tgwil.net>2024-10-21 03:34:47 -0400
commit28350a245e30866303a634744e6e68e63394e420 (patch)
treead3042e4650e62204127ea67114e14cad3551b7e
downloaddotfiles.sys-stable.tar.gz
dotfiles.sys-stable.tar.bz2
dotfiles.sys-stable.zip
Initial commitHEADstable
-rw-r--r--README.md16
-rwxr-xr-xnew-machine-setup.sh96
2 files changed, 112 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..171e40b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,16 @@
1# TGWIL Dotfiles.Sys
2
3These are my system-level configurations which apply to all machines.
4
5My other dotfiles:
6
7- [dotfiles.core](http://git.tgwil.net/dotfiles.core) for user-level configurations for all users on all machines.
8- [dotfiles.tgwil](http://git.tgwil.net/dotfiles.tgwil) for my personal daily-driver user.
9
10## Installation
11
12This one requires manual-as-fuck installation. Couldn't figure out how to make it convenient *and* secure, nor do I really care. How often do new machines come around anyways?
13
14
15# TODO
161. Figure out installation method that doesn't fucking suck.
diff --git a/new-machine-setup.sh b/new-machine-setup.sh
new file mode 100755
index 0000000..d1ea488
--- /dev/null
+++ b/new-machine-setup.sh
@@ -0,0 +1,96 @@
1#!/usr/local/bin/bash
2#
3# FILE : dotfiles.sys/new-machine.setup.sh
4# TARGET: none
5# AUTHOR: tgwil
6#
7# This script sets up a new machine.
8# It includes only things necessary for EVERY machine.
9#
10# This installer assumes that:
11# - this repository is cloned to /usr/local/share/dotfiles.sys
12# - /usr/local/share/dotfiles.sys/ is owned by root
13# - the installer is being run by a user with sudo privileges
14
15
16########################################################################
17## Setup
18########################################################################
19# Set script output colors
20GREEN="\e[32m"
21YELLOW="\e[33m"
22WARN="\e[1;31m"
23ENDCOLOR="\e[0m"
24
25
26# Check if running as root
27if [[ "${EUID}" -ne 0 ]]; then
28 echo -e "${WARN}WARNING: This script requires root privileges${ENDCOLOR}"
29 echo -e "INFO : Abort!"
30 exit 1
31else
32 # Startup message
33 echo "### Starting dotfiles.sys installation... ###"
34fi
35
36
37# Give user the chance to abort before shit starts happening.
38echo -e "${WARN}WARNING: This installer is meant for new machines. It will replace system-level configuration files. [A]bort, [C]ontinue: ${ENDCOLOR}"
39echo -en "\033[1A\033[1000C"
40read -n1 confirm
41confirm_invalid_selection=0
42while
43 case $confirm in
44 "a"|"A")
45 echo "INFO : Abort!"
46 exit 0;;
47 "c"|"C")
48 break;;
49 *)
50 echo -e "${WARN}ERROR : Invalid selection, try again...${ENDCOLOR}"
51 confirm_invalid_selection=1;;
52 esac
53 [[ $confirm_invalid_selection==1 ]]
54do true; done
55
56
57########################################################################
58## Install Packages
59########################################################################
60echo "INFO : Proceed with package installation? [y/n]: "
61echo -en "\033[1A\033[1000C"
62read -n1 do_package_install
63package_invalid_selection=0
64while
65 case $do_package_install in
66 "y"|"Y")
67 pkg update
68 pkg upgrade && sudo pkg install \
69 devel/autotools \
70 devel/cmake \
71 devel/git \
72 devel/libvterm \
73 devel/pkgconf \
74 devel/roswell \
75 editors/emacs \
76 editors/nano \
77 ports-mgmt/portconfig \
78 security/gnupg \
79 security/sudo \
80 shells/bash \
81 shells/bash-completion \
82 sysutils/coreutils \
83 sysutils/dmidecode \
84 sysutils/exa \
85 sysutils/gdisk
86 echo "INFO : Packages installed and updated."
87 break;;
88 "n"|"N")
89 echo "INFO : Skipping package installation and updates."
90 break;;
91 *)
92 echo -e "${WARN}ERROR : Invalid selection, try again...${ENDCOLOR}"
93 package_invalid_selection=1;;
94 esac
95 [[ $package_invalid_selection==1 ]]
96do true; done