Skip to content

Instantly share code, notes, and snippets.

@tykurtz
Last active April 1, 2021 05:27
Show Gist options
  • Save tykurtz/d53670e0142b92d49b364af41b45a119 to your computer and use it in GitHub Desktop.
Save tykurtz/d53670e0142b92d49b364af41b45a119 to your computer and use it in GitHub Desktop.
Dev environment setup for spacemacs with c++ dev
#!/bin/bash
# Install spacemacs
apt-get install -y emacs tmux git
git clone -b develop https://github.com/syl20bnr/spacemacs ~/.emacs.d
wget -O ~/.spacemacs https://gist.githubusercontent.com/tykurtz/41c6d7b0930b9f8b107265ab895114a4/raw/0eb1074ec368cd977d33a0de3b5b076dd6ea3a83/.spacemacs
# Install rtags
apt-get install -y llvm-dev libclang-dev clang cmake pkg-config bash-completion
mkdir ~/source_builds/
cd ~/source_builds
git clone --recursive https://github.com/Andersbakken/rtags.git
cd rtags
mkdir build
cd build
cmake ..
make -j $(nproc)
make install
# Setup rtags to run as a daemon
mkdir -p ~/.config/systemd/user/
echo "[Unit]
Description=RTags daemon socket
[Socket]
ListenStream=%t/rdm.socket
[Install]
WantedBy=default.target" >> ~/.config/systemd/user/rdm.socket
echo "[Unit]
Description=RTags daemon
Requires=rdm.socket
[Service]
Type=simple
ExecStart=/usr/local/bin/rdm -v --inactivity-timeout 300 --log-flush
ExecStartPost=/bin/sh -c \"echo +19 > /proc/$MAINPID/autogroup\"
Nice=19
CPUSchedulingPolicy=idle" >> ~/.config/systemd/user/rdm.service
# Start the daemon
systemctl --user enable rdm.socket
systemctl --user start rdm.socket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment