Overhaul provisioning script system

This commit is contained in:
Daniel Flanagan 2020-11-07 22:23:52 -06:00
parent 0c250a0b17
commit 40edd8d3c9
Signed by: lytedev
GPG Key ID: 5B2020A0F9921EF4
11 changed files with 79 additions and 118 deletions

View File

@ -70,9 +70,10 @@ distro_specific_root_setup() {
if test $is_nixos -eq 1; then
symlink_nixos "$root_home$dotfiles/env/nix/"
add_unstable_channel
nixos-rebuild switch
nixos-rebuild switch # this should create the `daniel` user
elif test $is_arch_linux -eq 1; then
# TODO: install any necessary packages for remaining setup portion
"$root_home$dotfiles/env/arch-linux/provision.d/00-add-user.bash"
printf ''
fi
}

17
env/arch-linux/provision.d/00-add-user.bash vendored Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
u=daniel
ud="/home/$u"
# user exists - we will assume setup has already run
if getent passwd "$u"; then exit 0; fi
groupadd admin 2>/dev/null
mkdir --parents "$ud/.home" "$ud/dl"
useradd --home-dir "$ud/.home" \
--groups "admin,users" \
--shell "/bin/bash" \
"$u"
chown --recursive "$u:$u" "$ud"
echo "Setting password for user '$u'"
passwd "$u"

View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
REPOSITORY_PATH="/tmp/provisioning"
pacman -S --needed git base-devel
mkdir -p "$REPOSITORY_PATH"
rm -rf "$REPOSITORY_PATH/yay"
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
yay -S yay
rm -rf "$REPOSITORY_PATH/yay"

View File

@ -5,10 +5,9 @@ if egrep -q '^\[multilib\]$' /etc/pacman.conf; then
else
echo "Enabling Multilib Repository (with sudo)..."
sudo sh -c 'echo -e "\n\n[multilib]\nInclude = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf'
yay -Sy
fi
yay -S \
yay -Sy \
xf86-input-libinput \
bluez bluez-libs bluez-utils bluez-tools `# Bluetooth` \
pigz `# Multi-core gzipping` \
@ -44,6 +43,48 @@ yay -S \
libinput libinput-gestures `# Trackpad Control` \
efibootmgr efivar `# UEFI Boot CLI Stuff` \
glu mesa wxgtk2 libpng `# Various` \
gammastep `# Redshift for Wayland`
curl -L -o "$HOME/.emoji.txt" https://lyte.dev/uploads/emoji.txt
gammastep `# Redshift for Wayland` \
weechat `# IRC Client` \
aria2 `# Downloads Manager` \
tree `# Handy Filesystem Viewing Utility` \
dmenu `# Application Launcher` \
ripgrep `# Code Search Utilities` \
fd `# File Search` \
sd `# Easy Find/Replace` \
fzf `# Fuzzy File Finder` \
htop `# Process Management and System Resources Monitoring` \
openssh mosh `# Remote Access` \
openssl `# Crypto` \
asdf-vm `# Runtime Version Manager` \
python python-pip `# Python 3 Language` \
pass `# Password Management` \
firefox-developer-edition `# Default Web Browser` \
rsync `# File Transfer` \
alsa-utils `# Audio Utilities` \
alsa-plugins `# Plugins for ALSA` \
pulseaudio pavucontrol pulsemixer `# Audio Backend and Controls` \
neovim `# Text Editors` \
unzip `# Simple Unzipping` \
tmux `# Terminal Multiplexer` \
kitty `# Almost Better Terminal Emulator` \
feh `# Image Viewer & Wallpaper Manager` \
wlroots-git sway-git `# Wayland Compositor` \
swaylock-git swayidle-git `# Auto-Locking for Sway` \
kanshi-git `# Monitor Management for Sway` \
waybar-git mako-git `# Sway Bar & Notifications` \
slurp grim wl-clipboard `# Sway Screen Selection & Clipping` \
ttf-iosevka `# Primary Fonts` \
ttf-font-awesome `# Icon Font` \
curl `# HTTP Utility` \
w3m `# Viewing Images in Terminals` \
jq `# CLI for Interacting with JSON` \
ranger `# CLI File Manager` \
httpie `# httpie and neovim dependencies` \
docker docker-compose `# Yummy containers` \
inotify-tools `# Watching` \
fish `# Shell` \
time `# GNU time` \
fortune-mod fortune-mod-archlinux `# Fortune` \
diff-so-fancy `# Fancy Diffs` \
oath-toolkit `# One-Time Passwords` \
sysstat `# System Statistics`

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
mkdir -p "$HOME/.config/systemd/user"
mkdir -p "$XDG_CONFIG_HOME/systemd/user"
[ ! -d "$XDG_CONFIG_HOME/tmux/plugins/tpm" ] && \
git clone https://github.com/tmux-plugins/tpm "$XDG_CONFIG_HOME/tmux/plugins/tpm"

2
env/arch-linux/provision.sh vendored Executable file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env sh
for file in "$(dirname "$0")/provision.d"/*; do "$file"; done

View File

@ -1,15 +0,0 @@
#!/usr/bin/env bash
USERNAME=daniel
GROUPS="admin,users"
groupadd admin 2>/dev/null
mkdir --parents "/home/$USERNAME/.home"
mkdir --parents "/home/$USERNAME/dl"
useradd --home-dir "/home/$USERNAME/.home" \
--groups "${GROUPS}" \
--shell "/bin/bash" \
"$USERNAME"
chown --recursive "$USERNAME:$USERNAME" "/home/$USERNAME"
echo "Setting password for user '$USERNAME'"
passwd "$USERNAME"

View File

@ -1,36 +0,0 @@
#!/usr/bin/env bash
# TODO: this script is out of date!
# installs pacaur on a fresh arch install
# install the dependencies
sudo pacman -S git curl openssl perl expac yajl meson gmock gtest jq make pkginfo --noconfirm
# setup a temporary place to install the packages from
REPOSITORY_PATH="/tmp/provisioning"
mkdir -p "$REPOSITORY_PATH"
# clone the repositories
rm -rf "$REPOSITORY_PATH/auracle-git"
rm -rf "$REPOSITORY_PATH/pacaur"
git clone https://aur.archlinux.org/auracle-git.git "$REPOSITORY_PATH/auracle-git"
git clone https://aur.archlinux.org/pacaur.git "$REPOSITORY_PATH/pacaur"
# build and install auracle
cd "$REPOSITORY_PATH/auracle-git"
makepkg -i --noconfirm
cd -
# build and install pacaur
cd "$REPOSITORY_PATH/pacaur"
makepkg -i --noconfirm
cd -
# cleanup
rm -rf "$REPOSITORY_PATH/auracle-git"
rm -rf "$REPOSITORY_PATH/pacaur"
# once installed, let the package manager manage itself and its dependencies
pacaur -S auracle-git pacaur --noconfirm --noedit

View File

@ -1,47 +0,0 @@
#!/usr/bin/env sh
yay -S \
weechat `# IRC Client` \
aria2 `# Downloads Manager` \
tree `# Handy Filesystem Viewing Utility` \
dmenu `# Application Launcher` \
ripgrep `# Code Search Utilities` \
fd `# File Search` \
sd `# Easy Find/Replace` \
fzf `# Fuzzy File Finder` \
htop `# Process Management and System Resources Monitoring` \
openssh mosh `# Remote Access` \
openssl `# Crypto` \
asdf-vm `# Runtime Version Manager` \
python python-pip `# Python 3 Language` \
pass `# Password Management` \
firefox-developer-edition `# Default Web Browser` \
rsync `# File Transfer` \
alsa-utils `# Audio Utilities` \
alsa-plugins `# Plugins for ALSA` \
pulseaudio pavucontrol pulsemixer `# Audio Backend and Controls` \
neovim `# Text Editors` \
unzip `# Simple Unzipping` \
tmux `# Terminal Multiplexer` \
kitty `# Almost Better Terminal Emulator` \
feh `# Image Viewer & Wallpaper Manager` \
wlroots-git sway-git `# Wayland Compositor` \
swaylock-git swayidle-git `# Auto-Locking for Sway` \
kanshi-git `# Monitor Management for Sway` \
waybar-git mako-git `# Sway Bar & Notifications` \
slurp grim wl-clipboard `# Sway Screen Selection & Clipping` \
ttf-iosevka `# Primary Fonts` \
ttf-font-awesome `# Icon Font` \
curl `# HTTP Utility` \
w3m `# Viewing Images in Terminals` \
jq `# CLI for Interacting with JSON` \
ranger `# CLI File Manager` \
httpie `# httpie and neovim dependencies` \
docker docker-compose `# Yummy containers` \
inotify-tools `# Watching` \
fish `# Shell` \
time `# GNU time` \
fortune-mod fortune-mod-archlinux `# Fortune` \
diff-so-fancy `# Fancy Diffs` \
oath-toolkit `# One-Time Passwords` \
sysstat `# System Statistics`

View File

@ -1,13 +0,0 @@
#!/usr/bin/env bash
yay -S weechat-poljar-matrix-git weechat-discord-git wee-slack
wcpm="/usr/lib/weechat/python/matrix"
hwcp="${HOME}/.weechat/python"
ln -s "${wcpm}/" "${hwcp}/"
ln -s "${wcpm}.py" "${hwcp}/"
ln -s "${wcpm}.py" "${hwcp}/autoload/"
ln -s "/usr/lib/weechat/python/wee_slack.py" "${hwcp}/"
ln -s "/usr/lib/weechat/python/wee_slack.py" "${hwcp}/autoload/"
# Scripts are in /usr/lib/weechat/python/matrix/contrib/