This repository has been archived by the owner on Oct 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-debian.sh
62 lines (57 loc) · 1.58 KB
/
setup-debian.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
#
## pass legit username as first arg.
## user isolated setup which uses $HOME/bin,
## use sudo.
function usage() {
# TODO: Write usage.
exit 1
}
# Make sure to run as root
if [[ ${UID} != 0 ]]; then
# not root
echo 'Please run as root.' >&2
usage
fi
USERNAME=''
# Check username
if [ "${#}" != 1 ] | [ "$(id ${1})" == 0 ] | [ ! -d "/home/${1}" ]; then
# there should be just one user specified
# and user should have a valid home folder.
echo 'Invalid user.'
usage
fi
USERNAME=${1}
DIR=$(dirname $0)
# If you're using **UBUNTU**, add 'universe' repo for fira-code.
sudo apt-add-repository contrib non-free
sudo apt update
sudo apt upgrade -y
# set up bash
sudo apt install git
bash $DIR/bash/setup.sh $USERNAME
source $DIR/bash/bash_profile
source $DIR/bash/bashrc
# install drivers
sudo apt install linux-headers-amd64 linux-image-amd64 nvidia-driver
# set up fonts
sudo apt install fonts-noto fonts-firacode fonts-powerline
# set up linuxbrew/homebrew
sudo apt install curl
mkdir -p /home/$USERNAME/brew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C /home/$USERNAME/brew
# python
sudo apt install python3-pip
## -- not necessary anymore with debian 12
#pip3 install virtualenv
## /usr/bin/python isn't available, link to python3
## -- not necessary anymore with debian 12
#sudo ln -s /usr/bin/python3 /usr/bin/python
# git
brew install diff-so-fancy node
# emacs
bash $DIR/emacs.d/setup.sh $USERNAME
# vim
bash $DIR/vim/setup.sh $USERNAME
# isolate
sudo chown -R $USERNAME /home/$USERNAME
sudo chmod -R go-rwx /home/$USERNAME