~cyplo/dotfiles

ref: 142dde34af2536d618f77d14858ac5d49c45c2cc dotfiles/common/configure_fresh_system -rwxr-xr-x 3.3 KiB
142dde34 — Cyryl Płotnicki-Chudyk Add cucumber-vim 5 years ago
                                                                                
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#!/bin/bash

SUDO=""
if [[ -z $NOSUDO ]]; then
    SUDO="sudo"
fi

echo "using '$SUDO' as sudo"

set -e
echo
echo "configuring settings common among OSes"
$SUDO true

#zsh
if [[ -z $DONT_CHANGE_SHELL ]]; then
    echo "changing shell to zsh"
    chsh -s `which zsh` $USER 
fi

CURL="curl -sSf"

if [[ -z $DIR ]]; then
    echo "please set DIR"
    exit 1
fi

DIR=`realpath $DIR`
echo "using $DIR as the top level directory"
cd $DIR
git submodule update --init --recursive

#configs
ln -vfs "$DIR/.vim" ~/.
ln -vfs "$DIR/.vimrc" ~/.
ln -vfs "$DIR/.tmux.conf" ~/.
rm -f "~/.zshrc"
ln -vfs "$DIR/.zshrc" ~/.
ln -vfs "$DIR/.setenv" ~/.
ln -vfs "$DIR/.oh-my-zsh" ~/.
ln -vfs "$DIR/.oh-my-zsh-plugins/zsh-syntax-highlighting" ~/.oh-my-zsh/custom/plugins/
ln -vfs "$DIR/.Slic3r" ~/.
ln -vfs "$DIR/.ghci" ~/.
ln -vfs "$DIR/.conkyrc" ~/.
mkdir -p ~/.kde/share/config/
ln -vfs "$DIR/.kdiff3rc" ~/.kde/share/config/kdiff3rc
ln -vfs "$DIR/.gitconfig.linux.private" ~/.gitconfig
mkdir -p ~/.config/autostart/
# autostart apps
ln -vfs "$DIR/.config/autostart/redshift-gtk.desktop" ~/.config/autostart/
mkdir -p ~/.config/vdirsyncer/
ln -vfs "$DIR/.config/vdirsyncer/config" ~/.config/vdirsyncer/
ln -vfs "$DIR/.config/redshift.conf" ~/.config/redshift.conf

source ~/.setenv

# symlink 'nodejs' as node on some systems
# will replace symlink if it exists, but won't replace regular file
if [[ ! -f /usr/bin/node ]]; then
    $SUDO ln -vfs /usr/bin/nodejs /usr/bin/node
fi

# tools
ln -vfs "$DIR/tools" ~/

# stuff that does not like symbolic links
mkdir -vp ~/.config/terminator
rm -f ~/.config/terminator/config
ln "$DIR/.config/terminator/config" ~/.config/terminator/config

#install fonts
mkdir -p ~/.fonts
cp -rv "$DIR/fonts" ~/.fonts
set +e
fc-cache -rv
$SUDO fc-cache -rv
set -e

if [[ -z $NORUST ]]; then
    #rust
    echo "installing rust"
    RUSTUP_TEMP="/tmp/blastoff.sh"
    $CURL https://sh.rustup.rs > "$RUSTUP_TEMP"
    chmod a+x "$RUSTUP_TEMP"
    "$RUSTUP_TEMP" -y
    rm -f "$RUSTUP_TEMP"
    rustup update
    rustup default stable
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
    cd "$DIR/../"
    echo "getting rust sources..."
    if [[ ! -d rust ]]; then
        git clone https://github.com/rust-lang/rust.git --recursive
    else
        cd rust 
        git pull
        git submodule update --init --recursive
    fi
    cargo install -f rustfmt
fi

if [[ -z $NORUBY ]]; then
    gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
    curl -sSL https://get.rvm.io | bash -s stable --ruby
fi

if [[ -z $NOVIM ]]; then
    echo "\n" | vim +PluginInstall +qa
    cd "$DIR/.vim/bundle/YouCompleteMe/"
    git submodule update --init --recursive
    if [[ -z $NORUST ]]; then
        ./install.py --racer-completer --clang-completer
    else
        ./install.py --clang-completer
    fi
fi

if [[ -z $NO_GO ]]; then
    export GOPATH="$HOME/go"
    mkdir -p "$GOPATH"

    # excercism
    go get -u github.com/exercism/cli/exercism
fi

# talks: reveal-md
$SUDO npm install -g reveal-md
$SUDO npm install -g diff-so-fancy

# vdir syncer
echo "installing vdirsyncer"
$SUDO pip install vdirsyncer

if [[ -z $USER ]]; then
    USER=`whoami`
fi

# normalize npm permissions
mkdir -p $HOME/.npm
$SUDO chown $USER $HOME/.npm -R

echo
echo "now go ahead and restart"
echo