diff options
author | Tristan Williams <tgwil@tgwil.net> | 2024-10-21 03:34:47 -0400 |
---|---|---|
committer | Tristan Williams <tgwil@tgwil.net> | 2024-10-21 03:34:47 -0400 |
commit | 28350a245e30866303a634744e6e68e63394e420 (patch) | |
tree | ad3042e4650e62204127ea67114e14cad3551b7e | |
download | dotfiles.sys-28350a245e30866303a634744e6e68e63394e420.tar.gz dotfiles.sys-28350a245e30866303a634744e6e68e63394e420.tar.bz2 dotfiles.sys-28350a245e30866303a634744e6e68e63394e420.zip |
-rw-r--r-- | README.md | 16 | ||||
-rwxr-xr-x | new-machine-setup.sh | 96 |
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 | |||
3 | These are my system-level configurations which apply to all machines. | ||
4 | |||
5 | My 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 | |||
12 | This 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 | ||
16 | 1. 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 | ||
20 | GREEN="\e[32m" | ||
21 | YELLOW="\e[33m" | ||
22 | WARN="\e[1;31m" | ||
23 | ENDCOLOR="\e[0m" | ||
24 | |||
25 | |||
26 | # Check if running as root | ||
27 | if [[ "${EUID}" -ne 0 ]]; then | ||
28 | echo -e "${WARN}WARNING: This script requires root privileges${ENDCOLOR}" | ||
29 | echo -e "INFO : Abort!" | ||
30 | exit 1 | ||
31 | else | ||
32 | # Startup message | ||
33 | echo "### Starting dotfiles.sys installation... ###" | ||
34 | fi | ||
35 | |||
36 | |||
37 | # Give user the chance to abort before shit starts happening. | ||
38 | echo -e "${WARN}WARNING: This installer is meant for new machines. It will replace system-level configuration files. [A]bort, [C]ontinue: ${ENDCOLOR}" | ||
39 | echo -en "\033[1A\033[1000C" | ||
40 | read -n1 confirm | ||
41 | confirm_invalid_selection=0 | ||
42 | while | ||
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 ]] | ||
54 | do true; done | ||
55 | |||
56 | |||
57 | ######################################################################## | ||
58 | ## Install Packages | ||
59 | ######################################################################## | ||
60 | echo "INFO : Proceed with package installation? [y/n]: " | ||
61 | echo -en "\033[1A\033[1000C" | ||
62 | read -n1 do_package_install | ||
63 | package_invalid_selection=0 | ||
64 | while | ||
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 ]] | ||
96 | do true; done | ||