You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.5 KiB
83 lines
2.5 KiB
#!/bin/bash |
|
|
|
####################################################### |
|
# # |
|
# An install script for zero-to-ready # |
|
# remote development boxes on Slackware # |
|
# !!! CURRENTLY UNTESTED !!! # |
|
# # |
|
# This assumes SSH Port is 3938, change this # |
|
# in the rc.firewall file to make sure # |
|
# iptables leaves it open for you. # |
|
# # |
|
# # |
|
# Author: Taylor Bockman <tbockman@taylorbockman.com> # |
|
# # |
|
# # |
|
####################################################### |
|
|
|
# Add user |
|
echo "Enter desired username:" |
|
read $newuser |
|
useradd -m -g users -G wheel,floppy,audio,video,cdrom,plugdev,power,netdev,lp,scanner -s /bin/bash $newuser |
|
|
|
# Modify sudoers to enable wheel group |
|
|
|
|
|
# Install some critical packages |
|
mkdir packages |
|
cd packages |
|
|
|
# Install Curl |
|
wget http://slackware.cs.utah.edu/pub/slackware/slackware64-14.1/slackware64/n/cyrus-sasl-2.1.23-x86_64-5.txz |
|
wget http://slackware.cs.utah.edu/pub/slackware/slackware64-14.1/slackware64/n/curl-7.31.0-x86_64-1.txz |
|
|
|
upgradepkg --install-new cyrus-sasl-2.1.23-x86-64-5.txz |
|
upgradepkg --install-new curl-7.31.0-x86_64-1.txz |
|
|
|
# Install libpcap and libnl for iptables |
|
wget libpcap-1.4.0-x86_64-1.txz |
|
wget libnl3-3.2.21-x86_64-1.txz |
|
|
|
upgradepkg --install-new libpcap-1.4.0-x86_64-1.txz |
|
upgradepkg --install-new libnl3-3.2.21-x86_64-1.txz |
|
|
|
cd .. |
|
|
|
# Become user to install nix |
|
echo "Becoming $newuser to install nix and packages..." |
|
su $newuser |
|
cd /home/$newuser |
|
|
|
# Install Nix |
|
curl https://nixos.org/nix/install | sh |
|
|
|
# Append the right stuff to the ~/.profiles file so nix is ready |
|
|
|
# Install various nix packages |
|
|
|
packages=("emacs", "vim", "zsh", "git", "tmux", "rlwrap", "rxvt-unicode") |
|
|
|
for package in "${packages[@]}" |
|
do |
|
: |
|
nix-env -i $package |
|
done |
|
|
|
# Symlink the rc.firewall to the right place |
|
# !!!! THIS PART IS SUPER UNTESTED !!!!! |
|
sudo ln -s /slackware-sysconfig/rc.firewall /etc/rc.d/rc.firewall |
|
sudo chmod +x /etc/rc.d/rc.firewall |
|
|
|
# Use sed to configure /etc/ssh/sshd_config to be more secure |
|
|
|
|
|
# Make zsh the default shell |
|
command -v zsh | sudo tee -a /etc/shells |
|
sudo chsh -s "$(command -v zsh)" "$USER" |
|
|
|
# cd into ~, git clone essentials |
|
|
|
# Run essentials dotfile install script |
|
|
|
# Restart sshd
|
|
|